You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Er...@swissinfo.ch on 2002/10/21 18:27:36 UTC

Locale problems with Chinese

Hi

I wonder if anyone has ever experienced problems with the Chinese locale.
Right now, we have a locale issue in our code because the system was built
with a chinese locale of "cn" instead of "zh" (in the variable
"currentLocale", see below). However, since in my test code, I set the
locale by hand, I reckon it should work anyway.

Consider the following code:
<c:if test="${currentLocale == 'cn'}">
   <jsp:useBean id="current" class="java.util.Date"/>
   <fmt:setLocale value="zh"/>
   Chinese:<br>
   <fmt:formatDate value="${current}" type="date" dateStyle="default"/><br>
   <fmt:formatDate value="${current}" type="date" dateStyle="short"/><br>
   <fmt:formatDate value="${current}" type="date" dateStyle="medium"/><br>
   <fmt:formatDate value="${current}" type="date" dateStyle="long"/><br>
   <fmt:formatDate value="${current}" type="date" dateStyle="full"/><br>
   <fmt:formatDate value="${current}" type="time" timeStyle="default"/><br>
   <fmt:formatDate value="${current}" type="time" timeStyle="short"/><br>
   <fmt:formatDate value="${current}" type="time" timeStyle="medium"/><br>
   <fmt:formatDate value="${current}" type="time" timeStyle="long"/><br>
   <fmt:formatDate value="${current}" type="time" timeStyle="full"/><br>
</c:if>

This shows the following output:
Chinese:
2002-10-21
02-10-21
2002-10-21
2002?10?21?
2002?10?21?
18:14:20
??6:14
18:14:20
??06?14?20?
18?14?20? MEST

Does anyone know why this could be?

Best regards,
Eric


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Locale problems with Chinese

Posted by Vernon Wu <ve...@gatewaytech.com>.
I have been using the Chinese locale with 'zh' setting and haven't observed any problems including date format. I don't 
know and never use the 'cn' setting. Why you don't use 'zh' ?




10/21/2002 9:27:36 AM, Eric.Lewis@swissinfo.ch wrote:

>Hi
>
>I wonder if anyone has ever experienced problems with the Chinese locale.
>Right now, we have a locale issue in our code because the system was built
>with a chinese locale of "cn" instead of "zh" (in the variable
>"currentLocale", see below). However, since in my test code, I set the
>locale by hand, I reckon it should work anyway.
>
>Consider the following code:
><c:if test="${currentLocale == 'cn'}">
>   <jsp:useBean id="current" class="java.util.Date"/>
>   <fmt:setLocale value="zh"/>
>   Chinese:<br>
>   <fmt:formatDate value="${current}" type="date" dateStyle="default"/><br>
>   <fmt:formatDate value="${current}" type="date" dateStyle="short"/><br>
>   <fmt:formatDate value="${current}" type="date" dateStyle="medium"/><br>
>   <fmt:formatDate value="${current}" type="date" dateStyle="long"/><br>
>   <fmt:formatDate value="${current}" type="date" dateStyle="full"/><br>
>   <fmt:formatDate value="${current}" type="time" timeStyle="default"/><br>
>   <fmt:formatDate value="${current}" type="time" timeStyle="short"/><br>
>   <fmt:formatDate value="${current}" type="time" timeStyle="medium"/><br>
>   <fmt:formatDate value="${current}" type="time" timeStyle="long"/><br>
>   <fmt:formatDate value="${current}" type="time" timeStyle="full"/><br>
></c:if>
>
>This shows the following output:
>Chinese:
>2002-10-21
>02-10-21
>2002-10-21
>2002?10?21?
>2002?10?21?
>18:14:20
>??6:14
>18:14:20
>??06?14?20?
>18?14?20? MEST
>
>Does anyone know why this could be?
>
>Best regards,
>Eric
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>