Link to home
Start Free TrialLog in
Avatar of Lalibela
Lalibela

asked on

Veclocity template for rtf and utf-8

Hello,

I have a velocity template which is saved as rtf. I need to populate the data from a database. Things are good as long as it is ascii but when I use unicode charcters all I get is garbage. Can some one give me a clue? I have changed my encoding to "utf-8" im my template servelet. And Is there a way that I can embed a macro in ms word that change a text to utf-8? just like the encoded text dialog in ms word?

Thanks,
Lalibela
:14:15
Avatar of bloodredsun
bloodredsun
Flag of Australia image

>>Things are good as long as it is ascii but when I use unicode charcters all I get is garbage
When you return unicode from the database or when you use unicode in the template? What does it currently output, any errors? Can you post some code, e.g. your template servlet.

When you connect to the database, are you specifying the encoding there as well, e.g. UTF-8?

Sorry to ask so many questions but you need to provide some more specific information.

>> And Is there a way that I can embed a macro in ms word that change a text to utf-8?
no idea, why not try asking this question in the word forum, https://www.experts-exchange.com/Applications/MS_Office/Word/
Avatar of Lalibela
Lalibela

ASKER

Hello

Thanks for your prompt response. I successfully connect to my DB and fetch the characters correctly as unicode I think there is no problem with it. But is there a possiblity like webpages to specify header info. for word?

Thanks
>>But is there a possiblity like webpages to specify header info. for word?

no idea, you'll have to ask this question in the word forum
Hello,

I found a solution. Just append the incoming unicode string with \'3f . That is all. And I need a refund of my points.

Laliblea,
:14:15
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial