#346 ✓ invalid
shitoupai

messages cannot support Chinese(中文)

Reported by shitoupai | October 28th, 2010 @ 02:43 PM

version:
occure on play 1.1 main from github,no problem using play 1.0.3.2

problem:

in the conf/messages, i define some message below:
admin.toolbar.role=角色管理

cannot show correct, i think it's OrderSafeProperties problem

Comments and changes to this ticket

  • Erwan Loisant

    Erwan Loisant November 4th, 2010 @ 05:20 PM

    Can you give more details, maybe post an example application? I'm able to use Japanese and there shouldn't be any difference with Chinese.

    Is your messages file encoded in valid UTF-8?

  • Guillaume Bort

    Guillaume Bort November 13th, 2010 @ 04:16 PM

    • State changed from “new” to “invalid”
  • Lyubomir Ivanov

    Lyubomir Ivanov April 6th, 2011 @ 02:02 PM

    We also have problems using Cyrillic letters. Suspected code is OrderSafeProperties. We are using play - 1.2.RC2. I did some debugging and I can confirm that OrderSafeProperties does not interpret utf-8 encoding properly. Here is my description:

    The Cyrillic letter х has Unicode code 0xd185. OrderSafeProperties.load() interprets each byte individually and when it comes to the second byte it thinks this is a new line (0x85) which apparently is not true. The second byte is wrongly interpreted of its own not in the context of previous byte (d1). This is a blocking bug, so please give us a fix in 1.2 release or even earlier. Should you need any cooperation with this issue I can do the tests or whatever you need. Thanks.

  • Lyubomir Ivanov

    Lyubomir Ivanov April 6th, 2011 @ 08:05 PM

    As digging deeper in the code I can see that 0x85 is used for detection of a new line. This is Unicode symbol NEL. But in UTF-8 this symbol is represented with two-byte sequence 0xc285. This obviously is not examined in the code. Generally, looking at the code, I can't see interpreting single bytes in the context of the first byte of a utf-8 byte sequence - there might be as many as 4 bytes in a sequence in utf-8.

  • Lyubomir Ivanov

    Lyubomir Ivanov April 7th, 2011 @ 08:15 AM

    Update: should I post a new ticket about this issue, because it does not effect the Chinese language support only?

  • jackywyz

    jackywyz April 14th, 2011 @ 08:30 AM

    I have the same problem in Play1.2 ,but Play 1.1.1 is ok.

  • shitoupai

    shitoupai April 14th, 2011 @ 08:37 AM

    OrderSafeProperties has problem.messages cannot support Chinese

  • Morten Kjetland

    Morten Kjetland April 14th, 2011 @ 08:38 AM

    Hi, this is probably same problem as http://play.lighthouseapp.com/projects/57987-play-framework/tickets...

    can you try with the patch there?

    It is almost exactly the same as 1.2

    If it works we can create a custom 1.2 with this fix.

    -morten

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Play framework

Play makes it easier to build Web applications with Java. It is a clean alternative to bloated Enterprise Java stacks. It focuses on developer productivity and targets RESTful architectures. Learn more on the http://www.playframework.org website.

Source code is hosted on github

Check out our repository at http://github.com/playframework/play

Contributing, creating a patch

Please read the contributor guide

Reporting Security Vulnerabilities

Since all bug reports are public, please report any security vulnerability directly to guillaume dot bort at gmail dot com.

Creating a bug report

Bug reports are incredibly helpful, so take time to report bugs and request features in our ticket tracker. We’re always grateful for patches to Play’s code. Indeed, bug reports with attached patches will get fixed far quickly than those without any.

Please include as much relevant information as possible including the exact framework version you're using and a code snippet that reproduces the problem.

Don't have too much expectations. Unless the bug is really a serious "everything is broken" thing, you're creating a ticket to start a discussion. Having a patch (or a branch on Github we can pull from) is better, but then again we'll only pull high quality branches that make sense to be in the core of Play.

Shared Ticket Bins

Referenced by

Pages