-
Notifications
You must be signed in to change notification settings - Fork 111
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
Output of toXML() for <real>s is locale-dependent and causes creation of invalid PList-XML #67
Comments
Hi I reproduce. The problem is caused by the use of the function floatval() which outputs a float in a format dependent on your locale. |
Please test the patch above, and feedback. |
The patch adds the dependency to install the php-intl-Extension. Using bigger numbers like |
Hi Yes, you're right. I add this extra attribute to the PR. However I cannot merge the fix right now : I need to add an unit test for your issue, and migrate test environment to github actions. I need some time to do this, merge and build a new release. EDIT : I added the dependency to php-intl. I think it is better to rely on NumberFormatter instead of a filthy string manipulation, which may break for some foreign language. |
Describe the bug
When using a locale that uses commas (,) instead of points (.) as decimal delimiter, the output of CFPropertyList::toXML() uses this charater for
<real>
s which is invalid PList-Data. The cause is probably some implicit toString conversion that will use the current locale.To Reproduce
Execute this script:
It's output will be:
Expected behavior
This output:
(
1.5
instead of1,5
)Desktop
The text was updated successfully, but these errors were encountered: