Jump to content

Umlauts in variables passwed to php via url...


viciouslime

Recommended Posts

I want to be able to request the following url:

http://localhost/AMIGO/process.php?deword=Emporkömmling&detype=2&enword=upstage

 

At the moment if deword has no umlauts in it, everything is processed perfectly, however, with an umlaut the database ends up with funny characters in the umlauts place. I have created a html form and submitted data that way and that works fine, but i have lots of data in text files that needs to be passed through process.php, the only way i know of doing that is converting it all into urls like above and then wgetting them all.

 

This works, except when the URL, like the one above (and about 2000 others out of my 17000) contains umlauts...

 

Does anyone have any solution to this. All I can find via google is that I have to replace umlauts in urls with "html code", e.g. ä = ä but the ampersand causes php to think it's about to be passed the next variable and breaks everything...

 

ANY sort of help would be VERY much appreciated.  :)

The database is in utf-8 yeh. I'm not quite sure what you mean about using url_encode. As it stands, I have 17,000 urls in a bash script like so:

 

#!/bin/bash

wget "http://localhost/AMIGO/process.php?deword=Aalbutt&detype=2&enword=plaice"

wget "http://localhost/AMIGO/process.php?deword=Aar&detype=2&enword=eagle"

wget "http://localhost/AMIGO/process.php?deword=A-Betrieb&detype=2&enword=class-A%20operation"

wget "http://localhost/AMIGO/process.php?deword=Abarbeitungszyklus&detype=2&enword=processing%20cycle"

...and so on

 

How would I apply what you say to this? Thanks very much for your help!

 

Well I'm trying to feed variables to a php script, via the URL, that contain umlauts. I think though, using what you've said, I might be onto a solution. Php needs umlauts feeding to it via the URL as the following:

 

ä = %C3%A4

 

Forget it all, it doesn't work :(

Ok, using the following PHP script, dreamt up thanks to your post, I have managed to complete the list above:

 

<meta http-equiv="content-type" content="text/html;charset=utf-8" />

<?

$url="aaaäAAAÄoooöOOOÖuuuüUUUÜsssß";

$fixed=urlencode($url);

print $fixed;

?>

 

It would appear that it is just impossible to send variables to php that contain umlauts  :'(

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.