cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <>
Subject Re: Remarks on i18n
Date Thu, 03 Feb 2000 08:14:50 GMT
On Mon, 31 Jan 2000, Victor Smirnov wrote:

> 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
> 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?

I haven't ever done any i18n stuff, so my input may be somewhat misguided,
but this seems like an important issue and shouldn't be left hanging. Is
it possible to query the XSLT processor to determine what the document's
desired encoding is? If that's not possible yet, would it be appropriate
to add yet another PI to cocoon:

<?cocoon-output-encoding type="whatever"?>

to handle this in the short-term?

- donald

View raw message