Re: x:out ignores XML documents character encoding
Eric Webster <[email protected]>
| Newsgroups | gmane.comp.jakarta.taglibs.user |
|---|---|
| Message-ID | <[email protected]> |
Yes, that fixed it. Once charEncoding="UTF-8" was set in the c:import
tag the x:out tags started to work. Thanks a bunch for you help!
Kris Schneider wrote:
> One quick thing to try - remove the lines:
>
> <% response.setContentType("text/html; charset=UTF-8"); %>
>
> and
>
> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
>
> Then, add the directive:
>
> <%@ page pageEncoding="UTF-8" %>
>
> Also import like so:
>
> <c:import url="/reports.xml" charEncoding="UTF-8"/>
>
> Does that change anything?
>
> Eric Webster wrote:
>> Perhaps someone can tell me if this is a bug or if I'm doing
>> something wrong.
>>
>> I have an XML document with some UTF-8 encoded strings in it. The XML
>> document is labeled as being encoded in UTF-8. I want to print those
>> strings out using the x:out tag in a UTF-8 encoded JSP. The problem
>> seems to be that strings which come out of x:out are always labeled
>> as being ISO-8859-1 encoded. This causes the JspWriter to perform an
>> unnecessary ISO-8859-1 to UTF-8 conversion on the string. The
>> resulting page is UTF-8 but the strings are incorrect due to the
>> conversion. (At least thats what I think is going on.)
>>
>> I've discovered a workaround to this problem. I create a new UTF-8
>> string based on the getBytes() of the string that comes out of x:out.
>> These strings show up correctly.
>>
>> I'm using Tomcat 5.5 and Standard-1.1 taglibs. Any thoughts? I'd
>> rather not have to use the workaround.
>>
>>
>>
>>
>>
>