You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Kurz Wolfgang <wo...@gwvs.de> on 2009/03/03 13:52:32 UTC

Jackrabbit encoding

Is there a way to set the encoding for Jackrabbit so all the content is UTF-8 encoded?

Thx in advance:-)

Re: Jackrabbit encoding

Posted by Thomas Müller <th...@day.com>.
Hi,

Most likely the encoding is broken in the web server (between the
browser and your application). I suggest debugging your application.

If you think it is a Jackrabbit problem, could you please create and
post a simple, standalone test case that reproduces the problem? It
would be great if the test case does not have any dependencies except
Jackrabbit (that is, a Java class that uses the JCR API and is run
using a static main method). Please include any initialization code,
configuration, and the Jackrabbit version you use.

Regards,
Thomas

On Tue, Mar 3, 2009 at 2:09 PM, Kurz Wolfgang <wo...@gwvs.de> wrote:
> Well i was thinking properties.
>
> Here is the problem I encounter:
>
> I have a String saved in Jackrabbit under the property Kategorie.
> Lets say the string is "Österreich"
>
> I read that string from jackrabbit and display it on my webpage.
> So far all looks fine.
>
> Now I send that same string right back to my jcr doa to do a query for the node with the property of that string.
> What gets sent to my dao is somehow encoded differently.
> The "Ö" becomes some weird symbol.
>
> If I do the following in my controller everything works fine:
> byte[] utf8Bytes = kat.getBytes("ISO-8859-1");
> kat = new String(utf8Bytes, "UTF-8");
>
> So I was wondering where the encoding goes wrong.
>
> Thx again.
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Julian Reschke [mailto:julian.reschke@gmx.de]
> Gesendet: Dienstag, 3. März 2009 14:01
> An: users@jackrabbit.apache.org
> Betreff: Re: Jackrabbit encoding
>
> Kurz Wolfgang wrote:
>> Is there a way to set the encoding for Jackrabbit so all the content is UTF-8 encoded?
>>
>> Thx in advance:-)
>
> Exactly what content? Node names? Properties other than binary properties?
>
> BR, Julian
>
>

AW: Jackrabbit encoding

Posted by Kurz Wolfgang <wo...@gwvs.de>.
Well i was thinking properties.

Here is the problem I encounter:

I have a String saved in Jackrabbit under the property Kategorie.
Lets say the string is "Österreich"

I read that string from jackrabbit and display it on my webpage. 
So far all looks fine.

Now I send that same string right back to my jcr doa to do a query for the node with the property of that string.
What gets sent to my dao is somehow encoded differently. 
The "Ö" becomes some weird symbol.

If I do the following in my controller everything works fine:
byte[] utf8Bytes = kat.getBytes("ISO-8859-1");
kat = new String(utf8Bytes, "UTF-8");

So I was wondering where the encoding goes wrong. 

Thx again.



-----Ursprüngliche Nachricht-----
Von: Julian Reschke [mailto:julian.reschke@gmx.de] 
Gesendet: Dienstag, 3. März 2009 14:01
An: users@jackrabbit.apache.org
Betreff: Re: Jackrabbit encoding

Kurz Wolfgang wrote:
> Is there a way to set the encoding for Jackrabbit so all the content is UTF-8 encoded?
> 
> Thx in advance:-)

Exactly what content? Node names? Properties other than binary properties?

BR, Julian


Re: Jackrabbit encoding

Posted by Julian Reschke <ju...@gmx.de>.
Kurz Wolfgang wrote:
> Is there a way to set the encoding for Jackrabbit so all the content is UTF-8 encoded?
> 
> Thx in advance:-)

Exactly what content? Node names? Properties other than binary properties?

BR, Julian


Re: Jackrabbit encoding

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Tue, Mar 3, 2009 at 1:52 PM, Kurz Wolfgang <wo...@gwvs.de> wrote:
> Is there a way to set the encoding for Jackrabbit so all the content is UTF-8 encoded?

I'm not sure what you're after here. All string values in Jackrabbit
(or any JCR implementation) are already Unicode strings, so no
encoding is needed. You'll get the UTF-8-encoded version of a string
when you call the getStream() method on the string value.

BR,

Jukka Zitting

Re: Jackrabbit encoding

Posted by Thomas Müller <th...@day.com>.
Hi,

Could you please clarify what you mean with "all the content"?

Regards,
Thomas