I have a velocity/html file. I'm trying to include/parse some simple HTML into a page.
If I just copy the text directly on the the main file, it works fine:
Miranda Kerr hasn’t been a Victoria’s Secret Angel for ...
If I create a separate VM file, and include it like so:
#parse("topicoftheday/homepagenews.vm")
I get bad character garbage:
Miranda Kerr hasn’t been a Victoria’s Secret Angel for
How? Why?
Thanks
Looks like you have 3 encodings used,
You are using the non-ASCII apostrophe U+2019. The UTF-8 sequence is E2 80 19, happens to be the 3 chars you see in Latin-1 displayed as ANSI.
You need to change all of them to UTF-8 because Latin-1/ANSI don't have this character. Or you should use ASCII apostrophe '.
For velocity, set this parameter,
input.encoding = UTF-8
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With