viciouslime Posted July 26, 2008 Share Posted July 26, 2008 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. Link to comment https://forums.phpfreaks.com/topic/116767-umlauts-in-variables-passwed-to-php-via-url/ Share on other sites More sharing options...
DarkWater Posted July 26, 2008 Share Posted July 26, 2008 The database is in UTF-8, right? Run url_encode on the strnig when you put it in the URL. Link to comment https://forums.phpfreaks.com/topic/116767-umlauts-in-variables-passwed-to-php-via-url/#findComment-600491 Share on other sites More sharing options...
viciouslime Posted July 26, 2008 Author Share Posted July 26, 2008 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! Link to comment https://forums.phpfreaks.com/topic/116767-umlauts-in-variables-passwed-to-php-via-url/#findComment-600496 Share on other sites More sharing options...
DarkWater Posted July 26, 2008 Share Posted July 26, 2008 Then what does this have to do with PHP? Link to comment https://forums.phpfreaks.com/topic/116767-umlauts-in-variables-passwed-to-php-via-url/#findComment-600497 Share on other sites More sharing options...
viciouslime Posted July 26, 2008 Author Share Posted July 26, 2008 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 Link to comment https://forums.phpfreaks.com/topic/116767-umlauts-in-variables-passwed-to-php-via-url/#findComment-600505 Share on other sites More sharing options...
viciouslime Posted July 26, 2008 Author Share Posted July 26, 2008 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 :'( Link to comment https://forums.phpfreaks.com/topic/116767-umlauts-in-variables-passwed-to-php-via-url/#findComment-600510 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.