-
Notifications
You must be signed in to change notification settings - Fork 14
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
UTF-8 BOM handling #2
base: master
Are you sure you want to change the base?
Conversation
I think this is outside the scope of JSMin, but this logic could go in a different class whose only purpose is to detect/convert these particular non-UTF8 encodings. Ideally it would also support iconv. |
I'd recommend JSMin\EncodingDetector with method getEncoding($input) and it would return 'UTF-8' if no BOM was present. |
Hi! Thanks for the feedback. I'll take care. Please give me a few days, I'm still learning git & github. :-) |
Please review the new encoder class and advise it anything should be changed. |
Was it OK to merge with your master or does it cause merge problems? It seems, the already-merged changes are now also in the pull request - but I did want to use all new test files in my feature branch... |
The and also the default value has changed to utf-8, so this would be breaking change because earlier versions the ini values default to to iso8859-1. and new code does always decode even if mbstring and iconv both are missing, resulting fatal error. |
Hi!
The BOM handling should take into account the different encoding types indicated by the BOM. Just removing the BOM only works for the most common way. The hungarian translation of the widely-used ckeditor nevertheless is an example where this fails. A derived test file showing the exception is included in the patch.
Thanks for considering this patch.