Letters from URLs received, for example www.mydomain.com/?name=john, okay
If they were in Russian, then I was getting ".
So I have $ name = iconv ("cp1251", "UTF-8", $ name); And now it works fine for Russian and English characters, but screws in other languages
For example, 'Janis' (Latvian) which used to work just before the icon, is now in 'jneninis' Turns.
Any idea, if there is a universal encoder that will work with it, do not screw both Syrilic languages and other languages? Basically this problem comes down to the problem of how the URL is encoded if you have given a given page:
If you are clicking on a link, then the browser will use the encoding of the request for the request, but if you enter the URL directly into the address bar of your browser, the behavior is not undetermined because there is no standardized method Use to enc Ding (Firefox UTF is -8 provide encoded using the URL of a about: config
switch.).
In addition to finding some encoding, there is no way to know the encoding in the URL provided in the request.
Edit:
To back up just what I said above, I have written a small test that shows the default behavior Five major browsers (in my case Mac OS X is running - Windows Vista by parallel in IE case):
$ p = $ _GET ['p']; ($ I = 0; $ i & lt; strlen ($ p); $ i ++) {// This indicates binary data received via URL in hex format Dicohex (ord ($ p [$ i]) ). ''; }
Calling leads to http: //path/to/script.php?p= äöü
- Safari (4.0 .5):
C3A 4C3B6C3BC
- Firefox (3.6.3):
C3A 4C3B6C 3 BC
- Google Chrome (5.0.375.38):
c3 a4 c3 b6 c3 bc
- Opera (10.10):
e4 F6 fc
- Internet Explorer (8.0.6001.18904):
e4 f6
So obviously the first three UTF- Using the 8 encoded URL, Opera and IES ISO-8859-1 or some versions of it Conclusion : You They can not be sure what the text encoding is sent through the URL.
Comments
Post a Comment