Few things. I would still suggest you to use UTF-8 with BOM encoding for .vm template files as a storage format. And if possible use UTF-8 as an output format as well to really be globally international-aware.
FileResourceLoader has a "unicode" boolean property among other loader properties. Set "true" and you may store .vm files as UTF-8 with BOM marker. Example code: http://koti.mbnet.fi/akini/java/unicodereader/ http://koti.mbnet.fi/akini/java/java_utf8_xml/ If you ask me, its a serious bug a Java does not recognize all unicode BOM markers. But "unicode=true" attribute fixes all problems in a Velocity engine. No wait, use use older Velocity 1.4. Hmm..well, I had created a customized UnicodeFileResourceLoader extension prior it was embedded to the Velocity project. I must look for it and upload to my website. What is it a servlet you use as an entry point for all .vm requests. Is it one of your own customized or Velocity provided servlet? Other issues: Make sure you put a proper http-header to the responses. You may need to customize the servlet you use as a request entry point. Content-Type: text/xml; charset=UTF8 Look for "output.encoding" attribute in a velocity properties. If I can remember correctly, older Velocity provided servlets use it for output encoding. --- ZEESHAN <[EMAIL PROTECTED]> wrote: > I am using Apace .Velocity 1.4 for creating Xml Files thru Template. My requirement is that the *Russian Xml files* to be created should be encoded in *CP-1251*. XML encoded in Character Set CP-1251 is properly viewed from browser as the tags of the xml file is also in Russian. > > The template i am using for creation of xml file is also encoded in CP1251 > > My problem is that the output File generated is > getting encoded in UTF-8 , instead of getting encoded in CP1251. > > Pls help me on how to get the output file encoded in > CP1251. > > -- > Thanks and Regards, > Zeeshanur Rahman, > 3i-Infotech Ltd. > Kazakhstan, Almaty, > Mob- +77077011654 ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
