admin@glassfish.java.net

Re: Properties with multibyte characters

From: Jason Lee <jason.d.lee_at_oracle.com>
Date: Mon, 13 Dec 2010 19:18:58 -0600

This issue seem to drop off the radar (my fault) so I opened two issues
on it:

GLASSFISH-15150 <http://java.net/jira/browse/GLASSFISH-15150>Multibyte
characters do not appear to be supported in domain.xml
GLASSFISH-15151 <http://java.net/jira/browse/GLASSFISH-15151>Need CLI
for manipulating properties

I know this is late in the cycle, so please let me know how I can help.
I have basic AdminCommand authoring knowledge, which I'm happy to put to
use if you need me to.

On 12/8/10 5:13 PM, Tom Mueller wrote:
> Well, the DomainXmlPersistence class has the following line:
>
> writer = xmlFactory.createXMLStreamWriter(new BufferedOutputStream(fos));
>
> where xmlFactory is the result of calling XMLFactory.newInstance().
>
> The javadocs for XMLOutputFactory are deficient in defining what
> encoding is used here. There is another createXMLStreamWriter method
> that takes the encoding as the second argument. So I suspect that the
> encoding you are getting is not UTF-8, but some other encoding that
> doesn't support multibyte characters.
>
> Tom
>
> On 12/8/2010 4:19 PM, Jason Lee wrote:
>> I'm looking at this issue ATM:
>> http://java.net/jira/browse/GLASSFISH-13641
>>
>> In short, if the user enters a multibyte value for a property name,
>> value, or description, it gets mangled when saved. I've verified
>> that the multibyte character String is passed correctly
>> browser->console->rest. In our REST code, we have this line of code:
>>
>> ConfigSupport.createAndSet((ConfigBean) parent, Property.class,
>> property);
>>
>> At this point, property is a Map with the correct
>> name/value/description values. However, somewhere inside (or beyond)
>> createAndSet(), the MB char String is mangled. It's possible, I
>> guess, that it could be an XML issue, and therein lies my question:
>> What do we need to do to allow the user to save a MB character
>> String? Is our REST code interacting with the HK2 DOM correctly? I
>> grepped what I felt might be likely places elsewhere in the GF tree,
>> but I can't find any similar scenarios.
>>
>> Any pointers would be much appreciated.
>>


-- 
Jason Lee
Senior Member of Technical Staff
GlassFish REST API / Administration Console
Oracle Corporation
Phone +1 405-216-3193
Blog http://blogs.steeplesoft.com