I am using a Velocity template, and when I use a variable with an apostrophe, i.e.:
$user's
where “user” is the variable name, I get the value for the variable translated, but the apostrophe turns into a bunch of question marks. For instance, if the value for “user” was “Mary Ann,” I’d get this:
Mary Ann????s
How can I “escape” the apostrophe so that the Velocity mergeTemplate method will not produce this output? BTW, the encoding that I’m sending to that method is iso-8859-1:
Velocity.mergeTemplate(template, TEMPLATE_ENCODING, context, string_writer);
Although we don’t have a Velocity properties file, it’s my understanding that this is the default Velocity encoding.
Any feedback would be greatly appreciated.
UPDATE: I can use the encoding amp#39; in the HTML template but I still have the same issue in the text template
If this template used in context of HTML you can use
’