<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<STYLE type=text/css>DIV {
        MARGIN: 0px
}
</STYLE>
<META content="MSHTML 6.00.6001.18148" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=046324412-22102008><FONT face=Arial
color=#0000ff size=2>I think it's more likely that System.out is not displaying
the Unicode string correctly - generally my experience is that the operating
system console is not capable of handling full Unicode, though it no doubt
depends on the operating system and its configuration.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=046324412-22102008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=046324412-22102008><FONT face=Arial
color=#0000ff size=2>I'm not sure why you would expect to see UTF-8 (as distinct
from other representations of Unicode).</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=046324412-22102008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=046324412-22102008><FONT face=Arial
color=#0000ff size=2>Michael Kay</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=046324412-22102008><FONT face=Arial
color=#0000ff size=2><A
href="http://www.saxonica.com/">http://www.saxonica.com/</A></FONT></SPAN></DIV><BR>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> jdom-interest-bounces@jdom.org
[mailto:jdom-interest-bounces@jdom.org] <B>On Behalf Of </B>Mike
Kyle<BR><B>Sent:</B> 22 October 2008 11:35<BR><B>To:</B>
jdom-interest@jdom.org<BR><B>Subject:</B> [jdom-interest] Format
problem?<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV
style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman,new york,times,serif">
<DIV>The following code does NOT produce the UTF-8 that I had expected. As far
as I can tell the Text element only seems to work with ASCII text. I would
have expected it to work with non-ASCII text. Or am I doing something
dumb?<BR><BR> private void jdomTest() throws
IOException<BR>
{<BR> Element element = new
Element("doc");<BR>
element.addContent(new
Text("\u4E2D\u6587"));<BR> Document
document = new
Document(element);<BR><BR>
StringWriter out = new
StringWriter();<BR> Format f =
Format.getPrettyFormat();<BR> new
XMLOutputter(f).output(document,
out);<BR> System.out.println("XML:
"+out);<BR>
}<BR><BR></DIV></DIV><BR></BLOCKQUOTE></BODY></HTML>