Re: [xsl] using xsl:message with UTF-8 characters

Subject: Re: [xsl] using xsl:message with UTF-8 characters
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Mon, 23 Apr 2007 12:23:50 +0200
Manfred Staudinger wrote:
Hi,
Tanks for your responses so far! All of you agree (as I do), that the standard
Windows shell is unable to display UTF-8 correctly.

It is not that hard to make windows command shell work with UTF-8. The default codepage for the Windows Shell is 437, which, I believe, is something ancient and not really useful with unicode. To enable UTF-8 support on Windows Console, you must do four things:


1. Trigger the unicode support for all pipe etc (default is ansi) with the command:
cmd /u


2. Set the font of the console to one that has glyphs in the unicode range:
- go to console system menu (Alt-Space)
- select Properties > Font
- select "Lucida Sans" (MS will automatically select "Lucida Sans Unicode" when it is needed and when it is available on your system)


3. Change the codepage of the console screen to use Unicode (default is IBM 437) with the command:
chcp 65001
4. Call your commands *without* using a batch file (won't work anymore...). You can put your command in an environment variable for convenience.



If you now run saxon, you will see the output as Unicode.


However, this won't solve your problem with xsl:message (sorry), because Saxon seems to emit the messages of xsl:message and fn:trace using Latin-1 encoding or similar (I believe it were nicer if Saxon would output in UTF-8, but maybe this is Sun Java's problem, not Saxon's). Resulting in empty output after the above mentioned procedure. Even if you use the 2>out.txt method mentioned earlier in this thread, you still need Saxon to output as UTF-8 firstly to get the correct results.

Some of this info is from this blog: http://blogs.msdn.com/michkap/archive/2006/03/06/544251.aspx

HTH (albeit a bit)

Cheers,
-- Abel Braaksma

Current Thread