-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Utf8 labels #4
Comments
Do you have an example that shows the error? Under normal circumstances, this can't happen, because either preg_split() handles UTF-8 and everything's fine, or if it doesn't, \s matches only on characters < 128 which appear in UTF-8 as themselves. Only bytes with the first bit 1 (= 128…255) can occur in different characters. |
The example is "test testà" (UTF8 encoded, à is c3a0 http://www.fileformat.info/info/unicode/char/00e0/index.htm) where ? is a bad character which ord is 195. When passed into htmlspecialchars, it crashes |
We just ran into this on a production system. It does seem unique to French, specifically using the à character in a label on a Windows machine will cause the label not to display. EDIT: The fix is trivial, patch incoming shortly. |
Hi,
in the function "testFitStringInTextBox" in driver.php
you tokenize the string using $tokens = preg_split( '/\s+/', $string );
when $string is in UTF 8 and using a 2 bytes character, the $tokens get corrupted and the labels can be turned to an empty string when the svg.php encodes() it using htmlspecialchars (returns empty string if char is wrong)
So the tokenization should take care of the encoding option !
Thank you for these components !
Nicolas.
The text was updated successfully, but these errors were encountered: