cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael French <mfre...@zycor.lgc.com>
Subject RE: Remarks on i18n
Date Thu, 03 Feb 2000 15:15:20 GMT

>
>> Hello!
>>
>> My first message was just to point out the problem.
>> Here I try to put the sugestion for improvement.
>>
>> Let's look at the tag
>> <?cocoon-format type="xxx/yyy"?>
>> We can include also the charset. This will be
>>
>> <?cocoon-format type="xxx/yyy" charset="zzz"?>
>>
>> The default charset can be set in config file (cocoon.properties):
>>

> For instance
> res.setContentType("text/html;charset=Cp1251");
> PrintWriter out = res.getWriter();
> Then the result is converted to Cp1251. We can put
> res.setContentType("text/html;charset=KOI8_R");
> and the string will be converted to KOI.

The 2.2 Servlet API has request.getLocale() and 
response.setLocale( . . ), so when you ask for the 
output stream writer, it is already created with the 
correct String-to-byte encoding converter.
So in future you shouldn't need to setContentType 
if you call getWriter after setLocale.

Mike

Mime
View raw message