-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Fix UTF-8 handling for VueJs scanner. #242
Conversation
# Conflicts: # tests/AssetsTest.php
coincidence? #241 :) |
@MarekGogol goddamnit. We just noticed this issue on Friday. What do you think if this solution (prepending XML encoding tag)? Calling htmlentities to convert characters seems a bit risky, not sure I trust PHP enough with encoding conversions (bad experience). Ran some benchmarks - xml tag approach is a tiny fraction faster too. |
I think your solution is good enough. VueJs template may not consist of To be honest, I am not 100% sure which one is better. I just brought solution from link below. But your solution might be faster, so we can apply yours... We should wait for the author of package, and we will see what next. |
@MarekGogol Yeah, that is the same SO post I was looking at 😂 I'm really happy that people are using the vue scanner and even contributing. Was not expecting that! (I was the author for vue scanner code) |
@oscarotero sorry to bother again, but without the fix package is unusable in production. 😬 |
So thanks @briedis ! VueJs is one of my favorite scanner :). I just didn't realize for one year that all my existing translations from VueJs templates in client projects are crap :D (nobody told me). This week I was working on my own project, and I find it out 😄 |
Ok. I have a package for that (https://github.com/oscarotero/html-parser/blob/master/src/Parser.php) but wouldn't like to add a dependency for this (maybe in v5, because we have a different package for each scanner). |
DOMDocument does not handle UTF8 well without using htmlentities() or prepending XM encoding tag.
Added a fix and a test.