Closed (fixed)
Project:
Webform
Version:
6.x-2.9
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
12 Apr 2010 at 05:41 UTC
Updated:
3 Sep 2010 at 18:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
quicksketchI haven't been able to reproduce this issue. It may be an environmental difference (make sure you have the mb_string PHP extension installed on your server).
Comment #2
putkonen commentedmbstring is installed. I'll attach a screenshot of the settings.
Comment #3
quicksketchWhat is p%E4ivi supposed to be (unencoded)? I think there's just a problem with your string. If you run
p%E4ivithrough rawurldecode() you don't get a valid return character. I've tried this with all kinds of strings and languages, I don't have any problems.Comment #4
putkonen commentedp%E4ivi = päivi.
You can verify this using:
http://www.albionresearch.com/misc/urlencode.php
Comment #5
quicksketchpäivi URL encoded is
p%C3%A4ivi, notp%E4ivi. I don't know what algorithm that JavaScript converter is using, but it's not the same format used by PHP's urlencode() and urldecode().Comment #6
putkonen commentedThis is interesting.
According to this thread, this seems to be an issue with Firefox:
http://old.nabble.com/Firefox-URL-encoding-td5982793.html
%E4 = latin-1 encoding for ä, %C3%A4 UTF-8. Firefox converts the URL to latin-1 encoding, which does not work with PHP's urldecode.
It would be great if also latin-1 encoding could be supported, but now we can get around this issue. Thanks!
Comment #7
quicksketchThis is probably because the HTML on the page defines itself as UTF8, all URL encodings probably also have to be UTF8.
Comment #8
quicksketchWe're reading directly from the PHP $_GET variable and don't do any decoding at all, it's just PHP doing the decoding for us. Since there could be any number of encodings (who says it's going to be Latin-1 and not Unicode or MacRoman?), I think the correct solution is just to make sure the encodings are correct to begin with and let PHP handle it as it would normally.