[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: 16-bit chars rendered as "?" in UTF-8?

Subject: Re: 16-bit chars rendered as "?" in UTF-8?
From: John English <john.foreign@xxxxxxxxx>
Date: Wed, 15 Aug 2012 16:38:01 +0300
Re:  16-bit chars rendered as "?" in UTF-8?
On 15/08/2012 12:29, David Carlisle wrote:
Are you sure that it's not being passed through an xml process expanding
the character references before being served?

I save the XML to a file just before I transform it:


      CharResponseWrapper wrapper = new
            CharResponseWrapper((HttpServletResponse)response);
      chain.doFilter(request,wrapper);
      s = wrapper.toString();
      if (debug.level != null) {
        String fn = "xml" + fileNo + ".xml";
        System.out.println("XSLT: " + fn + " (" +
                           response.getCharacterEncoding() + ")");
        FileWriter fw = new FileWriter(fn);
        fileNo = (fileNo + 1) % 8;
        fw.write(s);
        fw.close();
      }
      if (s.length() > 0) {
        Transformer transformer = xslt.newTransformer();
        Source transformSource = new StreamSource(new StringReader(s));
        StreamResult result = new StreamResult(response.getWriter());
        transformer.transform(transformSource, result);
      }

I then search the file with "od -b | grep ' [4-7][0-7][0-7]'", and
there is no match. So the file contains only 7-bit ASCII (or however
you want to say it!). Meanwhile the transformed response is squirted
back to the requesting browser.

And, as I said, the same document content with a different root node
processed by the same stylesheet using the code above produces either
the correct output or garbled output. Aaargh!

Any other thoughts?
--
John English

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.