Thanks for your suggestion, Jason.

I filed it.
http://code.google.com/p/googleappengine/issues/detail?id=2135

Thanks,

Yasuo Higa

On Thu, Sep 17, 2009 at 6:56 AM, Jason (Google) <apija...@google.com> wrote:
> Thanks for the extra digging, Yasuo. Feel free to file a bug in the issue
> tracker regarding the default character encoding issue:
>
> http://code.google.com/p/googleappengine/issues/list
>
> - Jason
>
> On Mon, Sep 14, 2009 at 7:13 PM, Yasuo Higa <higaya...@gmail.com> wrote:
>>
>> Hi Jason,
>>
>> Thanks for your reply.
>>
>> On Tue, Sep 15, 2009 at 8:21 AM, Jason (Google) <apija...@google.com>
>> wrote:
>> > You should add a filter that calls request.setCharacterEncoding() and
>> > sets
>> > the appropriate encoding before handling the request. If you query for
>> > the
>> > data without startsWith and display it on-screen, do you see what you
>> > expect
>> > or is it garbled?
>> >
>> I call request.setCharacterEncoding("UTF-8"),
>> and my JSP is not garbled.
>>
>> I think the cause is DatastoreQuery#getUpperLimitForStartsWithStr().
>> In the method, val.getBytes() is called.
>> String#getBytes() depends on default charset encoding.
>> "Shift_JIS" is used on my local server,
>> but an another charset encoding may be used on production server.
>>
>> The following code may work fine:
>> private Literal getUpperLimitForStartsWithStr(String val) {
>>    return new Literal(val + "\ufffd");
>> }
>>
>> > Also, make sure you add this line after declaring the Query:
>> >
>> > query.declareParameters("String content");
>> >
>> I use implicit parameter as :content.
>>
>> Thanks,
>>
>> Yasuo Higa
>>
>>
>> > - Jason
>> >
>> > On Sat, Sep 12, 2009 at 10:32 PM, Yasuo Higa <higaya...@gmail.com>
>> > wrote:
>> >>
>> >> Hi all,
>> >>
>> >> JDO startsWith for Japanese works fine on development server,
>> >> but it does not work on production server.
>> >>
>> >> The following url is my test application.
>> >> http://2.latest.higayasuo.appspot.com/blog/
>> >>
>> >> Test code:
>> >> Query query = pm.newQuery(Blog.class, "content.startsWith(:content)");
>> >> List<Blog> blogList = (List<Blog>)
>> >>  query.execute(request.getParameter("content"));
>> >> request.setAttribute("blogList", blogList);
>> >>
>> >> Blog.java:
>> >> @PersistenceCapable(identityType = IdentityType.APPLICATION)
>> >> public class Blog {
>> >>
>> >>   �...@primarykey
>> >>   �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>> >>   �...@extension(vendorName = "datanucleus", key = "gae.encoded-pk",
>> >> value = "true")
>> >>    private String key;
>> >>
>> >>   �...@persistent
>> >>    private String title;
>> >>
>> >>   �...@persistent
>> >>    private String content;
>> >>
>> >>    ...
>> >> }
>> >>
>> >> My jsp's encoding is UTF-8.
>> >>
>> >> Is there a workaround?
>> >>
>> >> Thanks,
>> >>
>> >> Yasuo Higa
>> >>
>> >>
>> >
>> >
>> > >
>> >
>>
>>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to