You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Alin Dosoniu <ad...@hotmail.com> on 2006/10/09 15:06:10 UTC

Re: TOMAHAWK-322: InputSuggestAjax: False Encoding with German Umlauts

Hi Gerald,

Did you found anything that could solve this issue?

Thank you,
Alin.

> Ok, thx werner for the work on this topic and your corresponding comments.
>
> I will have a deeper look into it the next days.
>
> regards,
>
> Gerald
>
> On 9/27/06, Werner Punz <we...@gmx.at> wrote:
>> Ok I looked deeper into the problem
>> and it seems that dojo itself is quite
>> intelligent in the way it handles the encoding issue:
>>
>> I tried with two encodings utf-8 and ISO-8859-1
>>
>> bind picks up the correct encoding and sends german umlauts
>> correctly down the server, the server than can pick up the data
>> from the given page encoding and parses them correctly.
>>
>> Also on a pure io bind the dojo init param bindEncoding alters
>> the encoding on the fly and you get garbage (or not how you see it)
>>
>>
>> I dont think the dojo transport layer is at fault here.
>> Gerald, I now have to push the ball towards you for a problem
>> in the component code itself.
>>
>>
>> Just a minor sidenote, i can recommend if you push data down
>> to use some kind of neutral encoding to escape such issues
>> (i do in my components anyway)
>> escape is a good way at least for european languages to
>> handle the encoding without too many language encoding issues.
>> also I cannot recommend to use iso-xxxx as page encodings, I had too
>> many issues with that (beginning from two different isos one with euro
>> symbol one without, having issues in ie with euro symbols in encodings
>> which should not have them on certain browsers while others do not have
>> them etc...)  utf-8 is fine for most cases, and I heartly can recommend
>> to use that as default if possible.


Re: TOMAHAWK-322: InputSuggestAjax: False Encoding with German Umlauts

Posted by Alin Dosoniu <ad...@hotmail.com>.
Hi,

I did some investigations but got no solution :(.

Something that I see it works not as wanted is 
InputSuggestAjaxRenderer.encodeAjax does not care about the charset. So, it 
uses UnicodeEncoder.encode and tries to convert bytes from UTF-8 (for 
special characters there are 2 bytes for one char) to something that can be 
used in html. So, for "\u015F" it calculates 2 values for html, one for each 
byte.
I don't want to say that UnicodeEncoder.encode is wrong, I only want to say 
that in the way it is used for this component in 
InputSuggestAjaxRenderer.encodeAjax it is clear that the result is not that 
wanted.
Maybe you can give me a hint how to solve this problem.

Best regards,
Alin.

> Hi,
>
> the charset issue is on my todo list. Unfortunately there is not that
> much time left at the moment. Hopefully i get working on this in the
> near future.
>
> If its that urgent for you, you may have to do a deeper look at it on
> your own. The problem should not be the biggest issue.
>
> cheers,
>
> Gerald
>
> On 10/11/06, Alin Dosoniu <ad...@hotmail.com> wrote:
>> Hi,
>>
>> Only wanted to tell you the following scenario I did:
>> In example from tomahawk I altered a little bit the code like this:
>> public String getSuggestValue() {
>>      if (suggestValue == null) {
>>           suggestValue = "\u015F";
>>     }
>>         return suggestValue;
>> }
>> the value "\u015F" represents 1 character from iso-8859-2 that converted 
>> for
>> html has value "ş". So, I thought that in inputSuggestAjax.jsf, when
>> displaying the page, the character should be correctly shown. But, it is
>> not. :(. Instead exactly this value ("ş") is shown in "default suggest"
>> selectbox.
>> After this test, I think there is another issue regarding charset on
>> inputSuggestAjax component:
>> the control does not render correct a value that is a valid html 
>> character
>> ("ş" == "s").
>>
>> Any help on this issue is appreciated.
>> Thank you,
>> Alin 


Re: TOMAHAWK-322: InputSuggestAjax: False Encoding with German Umlauts

Posted by Gerald Müllan <bi...@gmail.com>.
Hi,

the charset issue is on my todo list. Unfortunately there is not that
much time left at the moment. Hopefully i get working on this in the
near future.

If its that urgent for you, you may have to do a deeper look at it on
your own. The problem should not be the biggest issue.

cheers,

Gerald

On 10/11/06, Alin Dosoniu <ad...@hotmail.com> wrote:
> Hi,
>
> Only wanted to tell you the following scenario I did:
> In example from tomahawk I altered a little bit the code like this:
> public String getSuggestValue() {
>      if (suggestValue == null) {
>           suggestValue = "\u015F";
>     }
>         return suggestValue;
> }
> the value "\u015F" represents 1 character from iso-8859-2 that converted for
> html has value "ş". So, I thought that in inputSuggestAjax.jsf, when
> displaying the page, the character should be correctly shown. But, it is
> not. :(. Instead exactly this value ("ş") is shown in "default suggest"
> selectbox.
> After this test, I think there is another issue regarding charset on
> inputSuggestAjax component:
> the control does not render correct a value that is a valid html character
> ("ş" == "s").
>
> Any help on this issue is appreciated.
> Thank you,
> Alin
>
>
> > Hi Gerald,
> >
> > Did you found anything that could solve this issue?
> >
> > Thank you,
> > Alin.
> >
> >> Ok, thx werner for the work on this topic and your corresponding
> >> comments.
> >>
> >> I will have a deeper look into it the next days.
> >>
> >> regards,
> >>
> >> Gerald
>
>


-- 
http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: TOMAHAWK-322: InputSuggestAjax: False Encoding with German Umlauts

Posted by Jana Parvanova <ja...@sirma.bg>.
There are some chances this could be useful for you:

http://www.mail-archive.com/dev@myfaces.apache.org/msg15303.html

----- Original Message ----- 
From: "Alin Dosoniu" <ad...@hotmail.com>
To: "MyFaces Discussion" <us...@myfaces.apache.org>
Sent: Wednesday, October 11, 2006 6:56 PM
Subject: Re: TOMAHAWK-322: InputSuggestAjax: False Encoding with German 
Umlauts


> Hi,
>
> Only wanted to tell you the following scenario I did:
> In example from tomahawk I altered a little bit the code like this:
> public String getSuggestValue() {
>     if (suggestValue == null) {
>          suggestValue = "\u015F";
>    }
>        return suggestValue;
> }
> the value "\u015F" represents 1 character from iso-8859-2 that converted 
> for html has value "&#351;". So, I thought that in inputSuggestAjax.jsf, 
> when displaying the page, the character should be correctly shown. But, it 
> is not. :(. Instead exactly this value ("&#351;") is shown in "default 
> suggest" selectbox.
> After this test, I think there is another issue regarding charset on 
> inputSuggestAjax component:
> the control does not render correct a value that is a valid html character 
> ("&#351;" == "s").
>
> Any help on this issue is appreciated.
> Thank you,
> Alin
>
>
>> Hi Gerald,
>>
>> Did you found anything that could solve this issue?
>>
>> Thank you,
>> Alin.
>>
>>> Ok, thx werner for the work on this topic and your corresponding 
>>> comments.
>>>
>>> I will have a deeper look into it the next days.
>>>
>>> regards,
>>>
>>> Gerald
> 


Re: TOMAHAWK-322: InputSuggestAjax: False Encoding with German Umlauts

Posted by Alin Dosoniu <ad...@hotmail.com>.
Hi,

Only wanted to tell you the following scenario I did:
In example from tomahawk I altered a little bit the code like this:
public String getSuggestValue() {
     if (suggestValue == null) {
          suggestValue = "\u015F";
    }
        return suggestValue;
}
the value "\u015F" represents 1 character from iso-8859-2 that converted for 
html has value "&#351;". So, I thought that in inputSuggestAjax.jsf, when 
displaying the page, the character should be correctly shown. But, it is 
not. :(. Instead exactly this value ("&#351;") is shown in "default suggest" 
selectbox.
After this test, I think there is another issue regarding charset on 
inputSuggestAjax component:
the control does not render correct a value that is a valid html character 
("&#351;" == "s").

Any help on this issue is appreciated.
Thank you,
Alin


> Hi Gerald,
>
> Did you found anything that could solve this issue?
>
> Thank you,
> Alin.
>
>> Ok, thx werner for the work on this topic and your corresponding 
>> comments.
>>
>> I will have a deeper look into it the next days.
>>
>> regards,
>>
>> Gerald