cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Victor Smirnov" <vic...@uwc.ru>
Subject Remarks on i18n
Date Mon, 31 Jan 2000 14:49:33 GMT
Hello!

The problem, IMO, is rather funny. Let's take
/samples/hello/hello-page.xml
and change the greating to some what russian.
We get something like '???? ??????' in the browser.
That's not what is desired.

I've started experimenting around this.
I tried

diff -r1.10 Engine.java
316c316
<             out.println(page.getContent());
---
>             out.println(new String(page.getContent().getBytes(), 0));

This is the place, where results are sent back to client.
After applying this change, I've got correct russian text.
So, I can suppose, that servlet engine expects string in
"plain-ascii" and fails to convert anything else.
I looked at the servlet API (SDK 2.0) and found out
that there is no way to output byte array (or byte stream) to user -
only string, and there is no way to set the encoding of the
resulting byte array. (Correct me, if I'm wrong)
To overcome this we can have property which sets the result encoding
and enstead of
page.getContent().getBytes()
convert the result string to byte array in the proper encoding.

Propably this is the case with the current version of the Servlet API
and will be somehow fixed in future. May be someone can tell this?

IMO this is dirty hack, but do you have better ideas?

- Victor



Mime
View raw message