You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Ted Slusser <te...@yahoo.com> on 2003/06/09 19:53:09 UTC

unicode support

Hello,  I am trying to specify a unicode character in
an xml file that is consumed by digester.  When the
xml file is processed digester converts the unicode to
a literal string.  e.g. '\u00AE' becomes the string
"\\u00AE" which actually renders to "\u00AE".  Is
there some way to support unicode in digester?

Thanks,

Ted Slusser

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

Re: unicode support

Posted by Martin Cooper <ma...@apache.org>.
What encoding are you specifying in the XML declaration at the top of your
file? If you specify UTF-8, you should be able to just drop the UTF-8
characters directly into your XML file.

--
Martin Cooper


On Mon, 9 Jun 2003, Ted Slusser wrote:

> Hello,  I am trying to specify a unicode character in
> an xml file that is consumed by digester.  When the
> xml file is processed digester converts the unicode to
> a literal string.  e.g. '\u00AE' becomes the string
> "\\u00AE" which actually renders to "\u00AE".  Is
> there some way to support unicode in digester?
>
> Thanks,
>
> Ted Slusser
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>

Re: unicode support

Posted by Anton Tagunov <at...@mail.cnt.ru>.
Hello Ted!

Besides
    &0x00AE; (J.Pietschmann)
and
    <?xml version="1.0" encoding="UTF-8"?>

    <!-- edit this with UTF-8 enabled editor -->
    
    (Martin Cooper)

you may also _try_ to use your favourite encoding,
for instnace this might work

    <?xml version="1.0" encoding="windows-1251"?>

    <!-- edit with my favourite editor that supports
         editing texts in windows-1251 (windows cyrillic) -->

(substitute windows-1251 for your favourite)

Whether this will be accepted or not depends on the
XML parser that actually gets used. I recall that certain
versions of Xerces or Crimson (now shipped inside JDK 1.4,
essentially same as Xerces) did accept my favourite windows-1251,
while otheres refused. Try it.

- Anton

P.S. These are just general XML handling issues, not Digester's.
What has been said is true to any xml document.


Re: unicode support

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Ted Slusser wrote:
> Hello,  I am trying to specify a unicode character in
> an xml file that is consumed by digester.  When the
> xml file is processed digester converts the unicode to
> a literal string.  e.g. '\u00AE' becomes the string
> "\\u00AE" which actually renders to "\u00AE".  Is
> there some way to support unicode in digester?

Your source is XML? In this case you need to use XML
character references instead of Java Unicode escapes:
  &0x00AE;
(including the semicolon) would do the trick. For
additional info read the XML spec:
  http://www.w3.org/TR/REC-xml

J.Pietschmann


Re: unicode support

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
i had assumed (perhaps naively) that digester supported unicode correctly.
  certainly, this is the first issue i've heard of. if you could supply a 
simple test case demonstrating the problem (preferable one that you'd be 
willing to donate to the ASF) then i'll take a look.

- robert

On Monday, June 9, 2003, at 06:53 PM, Ted Slusser wrote:

> Hello,  I am trying to specify a unicode character in
> an xml file that is consumed by digester.  When the
> xml file is processed digester converts the unicode to
> a literal string.  e.g. '\u00AE' becomes the string
> "\\u00AE" which actually renders to "\u00AE".  Is
> there some way to support unicode in digester?
>
> Thanks,
>
> Ted Slusser
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>