You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Enrique Medina <e....@gmail.com> on 2005/08/24 17:07:49 UTC
Spanish accents in Javascript
Hi,
I know this is not a question directly related with MyFaces, but does
anybody knows how to solve this problem?
I define my literal strings in a properties file, and then I have created a
custom messages tag that renders the message as an alert of Javascript. So
when a JSF message is generated, it is rendered as an alert. My problem is
with accents. For example, in the alert window the text appears like:
"La fórmula es correcta"
while it should be:
"La fórmula es correcta"
Is it a matter of escaping the text in Javascript? Because I have tried the
escape() function but with no success...
Re: Spanish accents in Javascript
Posted by Matt Blum <mb...@gmail.com>.
Have you tried putting the Unicode encodings in the properties files? Java
uses the same encoding method, so it should work seamlessly with your
server-side code, too.
-Matt
On 8/24/05, Slawek <ss...@o2.pl> wrote:
>
> i have noticed strange corelations while displaying special (polish)
> characters:
>
> im also using message boundle and when im doing like that:
>
>
> function display(text){
> alert(text);
> }
>
>
> <h:commandButton ........... onclick=display(#{msg.message1}) />
>
> than everything is ok, but when doing it like that:
>
>
> function display(){
> text="<h:outputText value="#{msg.message1}"/>";
> alert(text);
> }
> <h:commanButton ........... onclick=display() />
>
>
> than i see \uSH1T or sth;)
>
>
> its little annoyin cause sommetimes my text should be constans and i dont
> need to pass it as parameter.
>
>
> cheers
>
> Sławek Sobótka
>
> > Hi Matt,
> >
> > But the problem is that encoding is generated by JSF when using EL like
> > this:
> >
> > #{messages.literal1}
> >
> > 2005/8/24, Matt Blum <mb...@gmail.com>:
> >>
> >> You need to use the Unicode encoding for the character, like so:
> >>
> >> "La f\u00f3rmula es correcta"
> >>
> >> There's a handy online tool to find the codes for most special
> >> characters
> >> here:
> >> http://www.saila.com/usage/tips/examples/special_characters.html
> >>
> >> -Matt
> >>
> >> On 8/24/05, Enrique Medina <e.medina.m@gmail.com > wrote:
> >> >
> >> > Hi,
> >> >
> >> > I know this is not a question directly related with MyFaces, but does
> >> > anybody knows how to solve this problem?
> >> >
> >> > I define my literal strings in a properties file, and then I have
> >> > created a custom messages tag that renders the message as an alert of
> >> > Javascript. So when a JSF message is generated, it is rendered as an
> >> alert.
> >> > My problem is with accents. For example, in the alert window the text
> >> > appears like:
> >> >
> >> > "La fórmula es correcta"
> >> >
> >> > while it should be:
> >> >
> >> > "La fórmula es correcta"
> >> >
> >> > Is it a matter of escaping the text in Javascript? Because I have
> >> tried
> >> > the escape() function but with no success...
> >> >
> >> >
> >>
>
>
>
Re: Spanish accents in Javascript
Posted by Slawek <ss...@o2.pl>.
i have noticed strange corelations while displaying special (polish)
characters:
im also using message boundle and when im doing like that:
function display(text){
alert(text);
}
<h:commandButton ........... onclick=display(#{msg.message1}) />
than everything is ok, but when doing it like that:
function display(){
text="<h:outputText value="#{msg.message1}"/>";
alert(text);
}
<h:commanButton ........... onclick=display() />
than i see \uSH1T or sth;)
its little annoyin cause sommetimes my text should be constans and i dont
need to pass it as parameter.
cheers
Sławek Sobótka
> Hi Matt,
>
> But the problem is that encoding is generated by JSF when using EL like
> this:
>
> #{messages.literal1}
>
> 2005/8/24, Matt Blum <mb...@gmail.com>:
>>
>> You need to use the Unicode encoding for the character, like so:
>>
>> "La f\u00f3rmula es correcta"
>>
>> There's a handy online tool to find the codes for most special
>> characters
>> here:
>> http://www.saila.com/usage/tips/examples/special_characters.html
>>
>> -Matt
>>
>> On 8/24/05, Enrique Medina <e.medina.m@gmail.com > wrote:
>> >
>> > Hi,
>> >
>> > I know this is not a question directly related with MyFaces, but does
>> > anybody knows how to solve this problem?
>> >
>> > I define my literal strings in a properties file, and then I have
>> > created a custom messages tag that renders the message as an alert of
>> > Javascript. So when a JSF message is generated, it is rendered as an
>> alert.
>> > My problem is with accents. For example, in the alert window the text
>> > appears like:
>> >
>> > "La fórmula es correcta"
>> >
>> > while it should be:
>> >
>> > "La fórmula es correcta"
>> >
>> > Is it a matter of escaping the text in Javascript? Because I have
>> tried
>> > the escape() function but with no success...
>> >
>> >
>>
Re: Spanish accents in Javascript
Posted by Enrique Medina <e....@gmail.com>.
I have just checked the Struts code (and sweet memories have come to me) and
the only reason why it is perfectly working is because no Unicode conversion
is done at all...
So again the question is:
Why is Unicode conversion applied in the HtmlResponseWriterImpl?
2005/8/30, Enrique Medina <e....@gmail.com>:
>
> I'll take a look at Struts to see whether I can infere the way to solve
> it...
>
> In the meantime, anyone that can tell us why is this done this way?
>
> 2005/8/30, Arash Bijanzadeh <ar...@gmail.com>:
> >
> > I don't know about the implementation but it works pretty fine in struts
> > i18n framework.
> >
> >
> > On 8/29/05, Enrique Medina <e.medina.m@gmail.com > wrote:
> > >
> > > Also notice that the use of \u-like text does not work for plain
> > > HTML....
> > >
> > > 2005/8/29, Enrique Medina < e.medina.m@gmail.com>:
> > > >
> > > > But to be honest, the problem is that the server side does not know
> > > > anything about how the client side is using the text.
> > > >
> > > > For example, the server does not know whether you will be using:
> > > >
> > > > alert('#{messages.text1}');
> > > >
> > > > or:
> > > >
> > > > <h:outputText value="#{messages.text1}"/>
> > > >
> > > > For both cases, the HTML entity code is generated:
> > > >
> > > > Camiūn
> > > >
> > > > 2005/8/29, Matt Blum <mb...@gmail.com>:
> > > > >
> > > > > You're absolutely right about the source of the problem.
> > > > >
> > > > > It seems to me that a better solution might be to fix the
> > > > > implementation. I don't see any reason to encode non-standard-ASCII
> > > > > characters with the "&#" encoding if rendering Javascript--stylesheets, yes,
> > > > > but not Javascript. With Javascript, the Unicode encoding of "\u" should be
> > > > > used. AFAIK, this should always work.
> > > > >
> > > > > Does anyone know of any reason why this shouldn't be done?
> > > > >
> > > > > -Matt
> > > > >
> > > > > On 8/29/05, Enrique Medina < e.medina.m@gmail.com> wrote:
> > > > > >
> > > > > > Definitively, the problem is that the JSF ResponseWriter always
> > > > > > encodes the text generating &#-like strings.
> > > > > >
> > > > > > So then a manual replace of these strings must be done within
> > > > > > the javascript section of the page :-(
> > > > > >
> > > > > > 2005/8/29, Enrique Medina < e.medina.m@gmail.com >:
> > > > > > >
> > > > > > > Hi again,
> > > > > > >
> > > > > > > I've been investigating this issue and the problem is here:
> > > > > > >
> > > > > > > HtmlResponseWriterImpl:
> > > > > > > ===================
> > > > > > > UnicodeEncoder.encode(strValue, false, false)
> > > > > > >
> > > > > > > All write methods use this call to the UnicodeEncoder, so the
> > > > > > > returned string always contains the ó or whatever.
> > > > > > >
> > > > > > > 2005/8/25, Matt Blum < mblum42@gmail.com >:
> > > > > > > >
> > > > > > > > Maybe the ConvertEncoding class in this article from
> > > > > > > > OnJava.com would be useful:
> > > > > > > >
> > > > > > > > http://www.onjava.com/pub/a/onjava/excerpt/javaexIAN3_chap8/index.html
> > > > > > > >
> > > > > > > >
> > > > > > > > If not, it might at least give you an idea how to fix your
> > > > > > > > issue.
> > > > > > > >
> > > > > > > > -Matt
> > > > > > > >
> > > > > > > >
> > > > > > > > On 8/25/05, Enrique Medina <e.medina.m@gmail.com > wrote:
> > > > > > > > >
> > > > > > > > > Hi Matt,
> > > > > > > > >
> > > > > > > > > Yes, the same thing occurs...
> > > > > > > > >
> > > > > > > > > 2005/8/25, Matt Blum < mblum42@gmail.com>:
> > > > > > > > > >
> > > > > > > > > > What does it do now? The same thing as before?
> > > > > > > > > >
> > > > > > > > > > -Matt
> > > > > > > > > >
> > > > > > > > > > On 8/25/05, Enrique Medina < e.medina.m@gmail.com>
> > > > > > > > > > wrote:
> > > > > > > > > > >
> > > > > > > > > > > I have tried to define my properties file (resource
> > > > > > > > > > > bundle) using Unicode encodings:
> > > > > > > > > > >
> > > > > > > > > > > combiVariables_ValidacionOK = La f\u00F3rmula es
> > > > > > > > > > > correcta
> > > > > > > > > > > combiVariables_ValidacionNotOK = La f\u00F3rmula no es
> > > > > > > > > > > correcta
> > > > > > > > > > >
> > > > > > > > > > > But it still doesn't work :-(
> > > > > > > > > > >
> > > > > > > > > > > 2005/8/25, Enrique Medina <e.medina.m@gmail.com >:
> > > > > > > > > > > >
> > > > > > > > > > > > Thanks. Let me try it ;-)
> > > > > > > > > > > >
> > > > > > > > > > > > 2005/8/25, Matt Blum <mb...@gmail.com>:
> > > > > > > > > > > > >
> > > > > > > > > > > > > I understand that. I'm suggesting that, instead of
> > > > > > > > > > > > > "La fórmula es correcta" in your properties file,
> > > > > > > > > > > > > you put "La f\u00f3rmula es correcta."
> > > > > > > > > > > > >
> > > > > > > > > > > > > -Matt
> > > > > > > > > > > > >
> > > > > > > > > > > > > On 8/24/05, Enrique Medina <e.medina.m@gmail.com >
> > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > Hi Matt,
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > But the problem is that encoding is generated by
> > > > > > > > > > > > > > JSF when using EL like this:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > #{messages.literal1}
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > 2005/8/24, Matt Blum <mb...@gmail.com>:
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > You need to use the Unicode encoding for the
> > > > > > > > > > > > > > > character, like so:
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > "La f\u00f3rmula es correcta"
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > There's a handy online tool to find the codes
> > > > > > > > > > > > > > > for most special characters here:
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > http://www.saila.com/usage/tips/examples/special_characters.html
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > -Matt
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > On 8/24/05, Enrique Medina <e.medina.m@gmail.com >
> > > > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > Hi,
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > I know this is not a question directly
> > > > > > > > > > > > > > > > related with MyFaces, but does anybody knows how to solve this problem?
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > I define my literal strings in a properties
> > > > > > > > > > > > > > > > file, and then I have created a custom messages tag that renders the message
> > > > > > > > > > > > > > > > as an alert of Javascript. So when a JSF message is generated, it is
> > > > > > > > > > > > > > > > rendered as an alert. My problem is with accents. For example, in the alert
> > > > > > > > > > > > > > > > window the text appears like:
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > "La fórmula es correcta"
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > while it should be:
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > "La fórmula es correcta"
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > Is it a matter of escaping the text in
> > > > > > > > > > > > > > > > Javascript? Because I have tried the escape() function but with no
> > > > > > > > > > > > > > > > success...
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> >
> > --
> > from debian manifesto:
> > Debian Linux is a brand-new kind of Linux distribution.
> > Rather than being developed by one isolated individua
> > l or group, as other distributions of Linux have been developed in the
> > past, Debian is being developed openly in the spirit of Linux and GNU.
>
>
>
Re: Spanish accents in Javascript
Posted by Enrique Medina <e....@gmail.com>.
I'll take a look at Struts to see whether I can infere the way to solve
it...
In the meantime, anyone that can tell us why is this done this way?
2005/8/30, Arash Bijanzadeh <ar...@gmail.com>:
>
> I don't know about the implementation but it works pretty fine in struts
> i18n framework.
>
>
> On 8/29/05, Enrique Medina <e....@gmail.com> wrote:
> >
> > Also notice that the use of \u-like text does not work for plain
> > HTML....
> >
> > 2005/8/29, Enrique Medina < e.medina.m@gmail.com>:
> > >
> > > But to be honest, the problem is that the server side does not know
> > > anything about how the client side is using the text.
> > >
> > > For example, the server does not know whether you will be using:
> > >
> > > alert('#{messages.text1}');
> > >
> > > or:
> > >
> > > <h:outputText value="#{messages.text1}"/>
> > >
> > > For both cases, the HTML entity code is generated:
> > >
> > > Camiūn
> > >
> > > 2005/8/29, Matt Blum <mb...@gmail.com>:
> > > >
> > > > You're absolutely right about the source of the problem.
> > > >
> > > > It seems to me that a better solution might be to fix the
> > > > implementation. I don't see any reason to encode non-standard-ASCII
> > > > characters with the "&#" encoding if rendering Javascript--stylesheets, yes,
> > > > but not Javascript. With Javascript, the Unicode encoding of "\u" should be
> > > > used. AFAIK, this should always work.
> > > >
> > > > Does anyone know of any reason why this shouldn't be done?
> > > >
> > > > -Matt
> > > >
> > > > On 8/29/05, Enrique Medina < e.medina.m@gmail.com> wrote:
> > > > >
> > > > > Definitively, the problem is that the JSF ResponseWriter always
> > > > > encodes the text generating &#-like strings.
> > > > >
> > > > > So then a manual replace of these strings must be done within the
> > > > > javascript section of the page :-(
> > > > >
> > > > > 2005/8/29, Enrique Medina < e.medina.m@gmail.com >:
> > > > > >
> > > > > > Hi again,
> > > > > >
> > > > > > I've been investigating this issue and the problem is here:
> > > > > >
> > > > > > HtmlResponseWriterImpl:
> > > > > > ===================
> > > > > > UnicodeEncoder.encode(strValue, false, false)
> > > > > >
> > > > > > All write methods use this call to the UnicodeEncoder, so the
> > > > > > returned string always contains the ó or whatever.
> > > > > >
> > > > > > 2005/8/25, Matt Blum < mblum42@gmail.com >:
> > > > > > >
> > > > > > > Maybe the ConvertEncoding class in this article from
> > > > > > > OnJava.com would be useful:
> > > > > > >
> > > > > > > http://www.onjava.com/pub/a/onjava/excerpt/javaexIAN3_chap8/index.html
> > > > > > >
> > > > > > >
> > > > > > > If not, it might at least give you an idea how to fix your
> > > > > > > issue.
> > > > > > >
> > > > > > > -Matt
> > > > > > >
> > > > > > >
> > > > > > > On 8/25/05, Enrique Medina <e.medina.m@gmail.com > wrote:
> > > > > > > >
> > > > > > > > Hi Matt,
> > > > > > > >
> > > > > > > > Yes, the same thing occurs...
> > > > > > > >
> > > > > > > > 2005/8/25, Matt Blum < mblum42@gmail.com>:
> > > > > > > > >
> > > > > > > > > What does it do now? The same thing as before?
> > > > > > > > >
> > > > > > > > > -Matt
> > > > > > > > >
> > > > > > > > > On 8/25/05, Enrique Medina < e.medina.m@gmail.com> wrote:
> > > > > > > > > >
> > > > > > > > > > I have tried to define my properties file (resource
> > > > > > > > > > bundle) using Unicode encodings:
> > > > > > > > > >
> > > > > > > > > > combiVariables_ValidacionOK = La f\u00F3rmula es
> > > > > > > > > > correcta
> > > > > > > > > > combiVariables_ValidacionNotOK = La f\u00F3rmula no es
> > > > > > > > > > correcta
> > > > > > > > > >
> > > > > > > > > > But it still doesn't work :-(
> > > > > > > > > >
> > > > > > > > > > 2005/8/25, Enrique Medina <e.medina.m@gmail.com >:
> > > > > > > > > > >
> > > > > > > > > > > Thanks. Let me try it ;-)
> > > > > > > > > > >
> > > > > > > > > > > 2005/8/25, Matt Blum <mb...@gmail.com>:
> > > > > > > > > > > >
> > > > > > > > > > > > I understand that. I'm suggesting that, instead of "La
> > > > > > > > > > > > fórmula es correcta" in your properties file, you put "La
> > > > > > > > > > > > f\u00f3rmula es correcta."
> > > > > > > > > > > >
> > > > > > > > > > > > -Matt
> > > > > > > > > > > >
> > > > > > > > > > > > On 8/24/05, Enrique Medina <e.medina.m@gmail.com >
> > > > > > > > > > > > wrote:
> > > > > > > > > > > > >
> > > > > > > > > > > > > Hi Matt,
> > > > > > > > > > > > >
> > > > > > > > > > > > > But the problem is that encoding is generated by
> > > > > > > > > > > > > JSF when using EL like this:
> > > > > > > > > > > > >
> > > > > > > > > > > > > #{messages.literal1}
> > > > > > > > > > > > >
> > > > > > > > > > > > > 2005/8/24, Matt Blum <mb...@gmail.com>:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > You need to use the Unicode encoding for the
> > > > > > > > > > > > > > character, like so:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > "La f\u00f3rmula es correcta"
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > There's a handy online tool to find the codes
> > > > > > > > > > > > > > for most special characters here:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > http://www.saila.com/usage/tips/examples/special_characters.html
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > -Matt
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > On 8/24/05, Enrique Medina <e.medina.m@gmail.com >
> > > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > Hi,
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > I know this is not a question directly related
> > > > > > > > > > > > > > > with MyFaces, but does anybody knows how to solve this problem?
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > I define my literal strings in a properties
> > > > > > > > > > > > > > > file, and then I have created a custom messages tag that renders the message
> > > > > > > > > > > > > > > as an alert of Javascript. So when a JSF message is generated, it is
> > > > > > > > > > > > > > > rendered as an alert. My problem is with accents. For example, in the alert
> > > > > > > > > > > > > > > window the text appears like:
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > "La fórmula es correcta"
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > while it should be:
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > "La fórmula es correcta"
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > Is it a matter of escaping the text in
> > > > > > > > > > > > > > > Javascript? Because I have tried the escape() function but with no
> > > > > > > > > > > > > > > success...
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
>
> --
> from debian manifesto:
> Debian Linux is a brand-new kind of Linux distribution.
> Rather than being developed by one isolated individua
> l or group, as other distributions of Linux have been developed in the
> past, Debian is being developed openly in the spirit of Linux and GNU.
Re: Spanish accents in Javascript
Posted by Arash Bijanzadeh <ar...@gmail.com>.
I don't know about the implementation but it works pretty fine in struts
i18n framework.
On 8/29/05, Enrique Medina <e....@gmail.com> wrote:
>
> Also notice that the use of \u-like text does not work for plain HTML....
>
> 2005/8/29, Enrique Medina <e....@gmail.com>:
> >
> > But to be honest, the problem is that the server side does not know
> > anything about how the client side is using the text.
> >
> > For example, the server does not know whether you will be using:
> >
> > alert('#{messages.text1}');
> >
> > or:
> >
> > <h:outputText value="#{messages.text1}"/>
> >
> > For both cases, the HTML entity code is generated:
> >
> > Camiūn
> >
> > 2005/8/29, Matt Blum <mb...@gmail.com>:
> > >
> > > You're absolutely right about the source of the problem.
> > >
> > > It seems to me that a better solution might be to fix the
> > > implementation. I don't see any reason to encode non-standard-ASCII
> > > characters with the "&#" encoding if rendering Javascript--stylesheets, yes,
> > > but not Javascript. With Javascript, the Unicode encoding of "\u" should be
> > > used. AFAIK, this should always work.
> > >
> > > Does anyone know of any reason why this shouldn't be done?
> > >
> > > -Matt
> > >
> > > On 8/29/05, Enrique Medina < e.medina.m@gmail.com> wrote:
> > > >
> > > > Definitively, the problem is that the JSF ResponseWriter always
> > > > encodes the text generating &#-like strings.
> > > >
> > > > So then a manual replace of these strings must be done within the
> > > > javascript section of the page :-(
> > > >
> > > > 2005/8/29, Enrique Medina < e.medina.m@gmail.com >:
> > > > >
> > > > > Hi again,
> > > > >
> > > > > I've been investigating this issue and the problem is here:
> > > > >
> > > > > HtmlResponseWriterImpl:
> > > > > ===================
> > > > > UnicodeEncoder.encode(strValue, false, false)
> > > > >
> > > > > All write methods use this call to the UnicodeEncoder, so the
> > > > > returned string always contains the ó or whatever.
> > > > >
> > > > > 2005/8/25, Matt Blum < mblum42@gmail.com >:
> > > > > >
> > > > > > Maybe the ConvertEncoding class in this article from OnJava.comwould be useful:
> > > > > >
> > > > > > http://www.onjava.com/pub/a/onjava/excerpt/javaexIAN3_chap8/index.html
> > > > > >
> > > > > >
> > > > > > If not, it might at least give you an idea how to fix your
> > > > > > issue.
> > > > > >
> > > > > > -Matt
> > > > > >
> > > > > >
> > > > > > On 8/25/05, Enrique Medina <e.medina.m@gmail.com > wrote:
> > > > > > >
> > > > > > > Hi Matt,
> > > > > > >
> > > > > > > Yes, the same thing occurs...
> > > > > > >
> > > > > > > 2005/8/25, Matt Blum < mblum42@gmail.com>:
> > > > > > > >
> > > > > > > > What does it do now? The same thing as before?
> > > > > > > >
> > > > > > > > -Matt
> > > > > > > >
> > > > > > > > On 8/25/05, Enrique Medina < e.medina.m@gmail.com> wrote:
> > > > > > > > >
> > > > > > > > > I have tried to define my properties file (resource
> > > > > > > > > bundle) using Unicode encodings:
> > > > > > > > >
> > > > > > > > > combiVariables_ValidacionOK = La f\u00F3rmula es correcta
> > > > > > > > > combiVariables_ValidacionNotOK = La f\u00F3rmula no es
> > > > > > > > > correcta
> > > > > > > > >
> > > > > > > > > But it still doesn't work :-(
> > > > > > > > >
> > > > > > > > > 2005/8/25, Enrique Medina <e.medina.m@gmail.com >:
> > > > > > > > > >
> > > > > > > > > > Thanks. Let me try it ;-)
> > > > > > > > > >
> > > > > > > > > > 2005/8/25, Matt Blum <mb...@gmail.com>:
> > > > > > > > > > >
> > > > > > > > > > > I understand that. I'm suggesting that, instead of "La
> > > > > > > > > > > fórmula es correcta" in your properties file, you put "La
> > > > > > > > > > > f\u00f3rmula es correcta."
> > > > > > > > > > >
> > > > > > > > > > > -Matt
> > > > > > > > > > >
> > > > > > > > > > > On 8/24/05, Enrique Medina <e.medina.m@gmail.com >
> > > > > > > > > > > wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > Hi Matt,
> > > > > > > > > > > >
> > > > > > > > > > > > But the problem is that encoding is generated by JSF
> > > > > > > > > > > > when using EL like this:
> > > > > > > > > > > >
> > > > > > > > > > > > #{messages.literal1}
> > > > > > > > > > > >
> > > > > > > > > > > > 2005/8/24, Matt Blum <mb...@gmail.com>:
> > > > > > > > > > > > >
> > > > > > > > > > > > > You need to use the Unicode encoding for the
> > > > > > > > > > > > > character, like so:
> > > > > > > > > > > > >
> > > > > > > > > > > > > "La f\u00f3rmula es correcta"
> > > > > > > > > > > > >
> > > > > > > > > > > > > There's a handy online tool to find the codes for
> > > > > > > > > > > > > most special characters here:
> > > > > > > > > > > > >
> > > > > > > > > > > > > http://www.saila.com/usage/tips/examples/special_characters.html
> > > > > > > > > > > > >
> > > > > > > > > > > > > -Matt
> > > > > > > > > > > > >
> > > > > > > > > > > > > On 8/24/05, Enrique Medina < e.medina.m@gmail.com >
> > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > Hi,
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > I know this is not a question directly related
> > > > > > > > > > > > > > with MyFaces, but does anybody knows how to solve this problem?
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > I define my literal strings in a properties
> > > > > > > > > > > > > > file, and then I have created a custom messages tag that renders the message
> > > > > > > > > > > > > > as an alert of Javascript. So when a JSF message is generated, it is
> > > > > > > > > > > > > > rendered as an alert. My problem is with accents. For example, in the alert
> > > > > > > > > > > > > > window the text appears like:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > "La fórmula es correcta"
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > while it should be:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > "La fórmula es correcta"
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > Is it a matter of escaping the text in
> > > > > > > > > > > > > > Javascript? Because I have tried the escape() function but with no
> > > > > > > > > > > > > > success...
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
--
from debian manifesto:
Debian Linux is a brand-new kind of Linux distribution.
Rather than being developed by one isolated individua
l or group, as other distributions of Linux have been developed in the
past, Debian is being developed openly in the spirit of Linux and GNU.
Re: Spanish accents in Javascript
Posted by Enrique Medina <e....@gmail.com>.
Also notice that the use of \u-like text does not work for plain HTML....
2005/8/29, Enrique Medina <e....@gmail.com>:
>
> But to be honest, the problem is that the server side does not know
> anything about how the client side is using the text.
>
> For example, the server does not know whether you will be using:
>
> alert('#{messages.text1}');
>
> or:
>
> <h:outputText value="#{messages.text1}"/>
>
> For both cases, the HTML entity code is generated:
>
> Camiūn
>
> 2005/8/29, Matt Blum <mb...@gmail.com>:
> >
> > You're absolutely right about the source of the problem.
> >
> > It seems to me that a better solution might be to fix the
> > implementation. I don't see any reason to encode non-standard-ASCII
> > characters with the "&#" encoding if rendering Javascript--stylesheets, yes,
> > but not Javascript. With Javascript, the Unicode encoding of "\u" should be
> > used. AFAIK, this should always work.
> >
> > Does anyone know of any reason why this shouldn't be done?
> >
> > -Matt
> >
> > On 8/29/05, Enrique Medina < e.medina.m@gmail.com> wrote:
> > >
> > > Definitively, the problem is that the JSF ResponseWriter always
> > > encodes the text generating &#-like strings.
> > >
> > > So then a manual replace of these strings must be done within the
> > > javascript section of the page :-(
> > >
> > > 2005/8/29, Enrique Medina < e.medina.m@gmail.com >:
> > > >
> > > > Hi again,
> > > >
> > > > I've been investigating this issue and the problem is here:
> > > >
> > > > HtmlResponseWriterImpl:
> > > > ===================
> > > > UnicodeEncoder.encode(strValue, false, false)
> > > >
> > > > All write methods use this call to the UnicodeEncoder, so the
> > > > returned string always contains the ó or whatever.
> > > >
> > > > 2005/8/25, Matt Blum < mblum42@gmail.com >:
> > > > >
> > > > > Maybe the ConvertEncoding class in this article from OnJava.comwould be useful:
> > > > >
> > > > > http://www.onjava.com/pub/a/onjava/excerpt/javaexIAN3_chap8/index.html
> > > > >
> > > > >
> > > > > If not, it might at least give you an idea how to fix your issue.
> > > > >
> > > > > -Matt
> > > > >
> > > > >
> > > > > On 8/25/05, Enrique Medina <e.medina.m@gmail.com > wrote:
> > > > > >
> > > > > > Hi Matt,
> > > > > >
> > > > > > Yes, the same thing occurs...
> > > > > >
> > > > > > 2005/8/25, Matt Blum < mblum42@gmail.com>:
> > > > > > >
> > > > > > > What does it do now? The same thing as before?
> > > > > > >
> > > > > > > -Matt
> > > > > > >
> > > > > > > On 8/25/05, Enrique Medina < e.medina.m@gmail.com> wrote:
> > > > > > > >
> > > > > > > > I have tried to define my properties file (resource bundle)
> > > > > > > > using Unicode encodings:
> > > > > > > >
> > > > > > > > combiVariables_ValidacionOK = La f\u00F3rmula es correcta
> > > > > > > > combiVariables_ValidacionNotOK = La f\u00F3rmula no es
> > > > > > > > correcta
> > > > > > > >
> > > > > > > > But it still doesn't work :-(
> > > > > > > >
> > > > > > > > 2005/8/25, Enrique Medina <e.medina.m@gmail.com >:
> > > > > > > > >
> > > > > > > > > Thanks. Let me try it ;-)
> > > > > > > > >
> > > > > > > > > 2005/8/25, Matt Blum <mb...@gmail.com>:
> > > > > > > > > >
> > > > > > > > > > I understand that. I'm suggesting that, instead of "La
> > > > > > > > > > fórmula es correcta" in your properties file, you put "La
> > > > > > > > > > f\u00f3rmula es correcta."
> > > > > > > > > >
> > > > > > > > > > -Matt
> > > > > > > > > >
> > > > > > > > > > On 8/24/05, Enrique Medina <e.medina.m@gmail.com >
> > > > > > > > > > wrote:
> > > > > > > > > > >
> > > > > > > > > > > Hi Matt,
> > > > > > > > > > >
> > > > > > > > > > > But the problem is that encoding is generated by JSF
> > > > > > > > > > > when using EL like this:
> > > > > > > > > > >
> > > > > > > > > > > #{messages.literal1}
> > > > > > > > > > >
> > > > > > > > > > > 2005/8/24, Matt Blum <mb...@gmail.com>:
> > > > > > > > > > > >
> > > > > > > > > > > > You need to use the Unicode encoding for the
> > > > > > > > > > > > character, like so:
> > > > > > > > > > > >
> > > > > > > > > > > > "La f\u00f3rmula es correcta"
> > > > > > > > > > > >
> > > > > > > > > > > > There's a handy online tool to find the codes for
> > > > > > > > > > > > most special characters here:
> > > > > > > > > > > >
> > > > > > > > > > > > http://www.saila.com/usage/tips/examples/special_characters.html
> > > > > > > > > > > >
> > > > > > > > > > > > -Matt
> > > > > > > > > > > >
> > > > > > > > > > > > On 8/24/05, Enrique Medina < e.medina.m@gmail.com >
> > > > > > > > > > > > wrote:
> > > > > > > > > > > > >
> > > > > > > > > > > > > Hi,
> > > > > > > > > > > > >
> > > > > > > > > > > > > I know this is not a question directly related
> > > > > > > > > > > > > with MyFaces, but does anybody knows how to solve this problem?
> > > > > > > > > > > > >
> > > > > > > > > > > > > I define my literal strings in a properties file,
> > > > > > > > > > > > > and then I have created a custom messages tag that renders the message as an
> > > > > > > > > > > > > alert of Javascript. So when a JSF message is generated, it is rendered as
> > > > > > > > > > > > > an alert. My problem is with accents. For example, in the alert window the
> > > > > > > > > > > > > text appears like:
> > > > > > > > > > > > >
> > > > > > > > > > > > > "La fórmula es correcta"
> > > > > > > > > > > > >
> > > > > > > > > > > > > while it should be:
> > > > > > > > > > > > >
> > > > > > > > > > > > > "La fórmula es correcta"
> > > > > > > > > > > > >
> > > > > > > > > > > > > Is it a matter of escaping the text in Javascript?
> > > > > > > > > > > > > Because I have tried the escape() function but with no success...
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Re: Spanish accents in Javascript
Posted by Enrique Medina <e....@gmail.com>.
But to be honest, the problem is that the server side does not know anything
about how the client side is using the text.
For example, the server does not know whether you will be using:
alert('#{messages.text1}');
or:
<h:outputText value="#{messages.text1}"/>
For both cases, the HTML entity code is generated:
Camiūn
2005/8/29, Matt Blum <mb...@gmail.com>:
>
> You're absolutely right about the source of the problem.
>
> It seems to me that a better solution might be to fix the implementation.
> I don't see any reason to encode non-standard-ASCII characters with the "&#"
> encoding if rendering Javascript--stylesheets, yes, but not Javascript. With
> Javascript, the Unicode encoding of "\u" should be used. AFAIK, this should
> always work.
>
> Does anyone know of any reason why this shouldn't be done?
>
> -Matt
>
> On 8/29/05, Enrique Medina <e....@gmail.com> wrote:
> >
> > Definitively, the problem is that the JSF ResponseWriter always encodes
> > the text generating &#-like strings.
> >
> > So then a manual replace of these strings must be done within the
> > javascript section of the page :-(
> >
> > 2005/8/29, Enrique Medina < e.medina.m@gmail.com >:
> > >
> > > Hi again,
> > >
> > > I've been investigating this issue and the problem is here:
> > >
> > > HtmlResponseWriterImpl:
> > > ===================
> > > UnicodeEncoder.encode(strValue, false, false)
> > >
> > > All write methods use this call to the UnicodeEncoder, so the returned
> > > string always contains the ó or whatever.
> > >
> > > 2005/8/25, Matt Blum < mblum42@gmail.com >:
> > > >
> > > > Maybe the ConvertEncoding class in this article from OnJava.comwould be useful:
> > > >
> > > > http://www.onjava.com/pub/a/onjava/excerpt/javaexIAN3_chap8/index.html
> > > >
> > > >
> > > > If not, it might at least give you an idea how to fix your issue.
> > > >
> > > > -Matt
> > > >
> > > >
> > > > On 8/25/05, Enrique Medina <e.medina.m@gmail.com > wrote:
> > > > >
> > > > > Hi Matt,
> > > > >
> > > > > Yes, the same thing occurs...
> > > > >
> > > > > 2005/8/25, Matt Blum < mblum42@gmail.com>:
> > > > > >
> > > > > > What does it do now? The same thing as before?
> > > > > >
> > > > > > -Matt
> > > > > >
> > > > > > On 8/25/05, Enrique Medina < e.medina.m@gmail.com> wrote:
> > > > > > >
> > > > > > > I have tried to define my properties file (resource bundle)
> > > > > > > using Unicode encodings:
> > > > > > >
> > > > > > > combiVariables_ValidacionOK = La f\u00F3rmula es correcta
> > > > > > > combiVariables_ValidacionNotOK = La f\u00F3rmula no es
> > > > > > > correcta
> > > > > > >
> > > > > > > But it still doesn't work :-(
> > > > > > >
> > > > > > > 2005/8/25, Enrique Medina <e.medina.m@gmail.com >:
> > > > > > > >
> > > > > > > > Thanks. Let me try it ;-)
> > > > > > > >
> > > > > > > > 2005/8/25, Matt Blum <mb...@gmail.com>:
> > > > > > > > >
> > > > > > > > > I understand that. I'm suggesting that, instead of "La
> > > > > > > > > fórmula es correcta" in your properties file, you put "La
> > > > > > > > > f\u00f3rmula es correcta."
> > > > > > > > >
> > > > > > > > > -Matt
> > > > > > > > >
> > > > > > > > > On 8/24/05, Enrique Medina <e.medina.m@gmail.com > wrote:
> > > > > > > > > >
> > > > > > > > > > Hi Matt,
> > > > > > > > > >
> > > > > > > > > > But the problem is that encoding is generated by JSF
> > > > > > > > > > when using EL like this:
> > > > > > > > > >
> > > > > > > > > > #{messages.literal1}
> > > > > > > > > >
> > > > > > > > > > 2005/8/24, Matt Blum <mb...@gmail.com>:
> > > > > > > > > > >
> > > > > > > > > > > You need to use the Unicode encoding for the
> > > > > > > > > > > character, like so:
> > > > > > > > > > >
> > > > > > > > > > > "La f\u00f3rmula es correcta"
> > > > > > > > > > >
> > > > > > > > > > > There's a handy online tool to find the codes for most
> > > > > > > > > > > special characters here:
> > > > > > > > > > >
> > > > > > > > > > > http://www.saila.com/usage/tips/examples/special_characters.html
> > > > > > > > > > >
> > > > > > > > > > > -Matt
> > > > > > > > > > >
> > > > > > > > > > > On 8/24/05, Enrique Medina < e.medina.m@gmail.com >
> > > > > > > > > > > wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > Hi,
> > > > > > > > > > > >
> > > > > > > > > > > > I know this is not a question directly related with
> > > > > > > > > > > > MyFaces, but does anybody knows how to solve this problem?
> > > > > > > > > > > >
> > > > > > > > > > > > I define my literal strings in a properties file,
> > > > > > > > > > > > and then I have created a custom messages tag that renders the message as an
> > > > > > > > > > > > alert of Javascript. So when a JSF message is generated, it is rendered as
> > > > > > > > > > > > an alert. My problem is with accents. For example, in the alert window the
> > > > > > > > > > > > text appears like:
> > > > > > > > > > > >
> > > > > > > > > > > > "La fórmula es correcta"
> > > > > > > > > > > >
> > > > > > > > > > > > while it should be:
> > > > > > > > > > > >
> > > > > > > > > > > > "La fórmula es correcta"
> > > > > > > > > > > >
> > > > > > > > > > > > Is it a matter of escaping the text in Javascript?
> > > > > > > > > > > > Because I have tried the escape() function but with no success...
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Re: Spanish accents in Javascript
Posted by Matt Blum <mb...@gmail.com>.
You're absolutely right about the source of the problem.
It seems to me that a better solution might be to fix the implementation. I
don't see any reason to encode non-standard-ASCII characters with the "&#"
encoding if rendering Javascript--stylesheets, yes, but not Javascript. With
Javascript, the Unicode encoding of "\u" should be used. AFAIK, this should
always work.
Does anyone know of any reason why this shouldn't be done?
-Matt
On 8/29/05, Enrique Medina <e....@gmail.com> wrote:
>
> Definitively, the problem is that the JSF ResponseWriter always encodes
> the text generating &#-like strings.
>
> So then a manual replace of these strings must be done within the
> javascript section of the page :-(
>
> 2005/8/29, Enrique Medina <e.medina.m@gmail.com >:
> >
> > Hi again,
> >
> > I've been investigating this issue and the problem is here:
> >
> > HtmlResponseWriterImpl:
> > ===================
> > UnicodeEncoder.encode(strValue, false, false)
> >
> > All write methods use this call to the UnicodeEncoder, so the returned
> > string always contains the ó or whatever.
> >
> > 2005/8/25, Matt Blum < mblum42@gmail.com >:
> > >
> > > Maybe the ConvertEncoding class in this article from OnJava.com would
> > > be useful:
> > >
> > > http://www.onjava.com/pub/a/onjava/excerpt/javaexIAN3_chap8/index.html
> > >
> > >
> > > If not, it might at least give you an idea how to fix your issue.
> > >
> > > -Matt
> > >
> > >
> > > On 8/25/05, Enrique Medina <e.medina.m@gmail.com > wrote:
> > > >
> > > > Hi Matt,
> > > >
> > > > Yes, the same thing occurs...
> > > >
> > > > 2005/8/25, Matt Blum < mblum42@gmail.com>:
> > > > >
> > > > > What does it do now? The same thing as before?
> > > > >
> > > > > -Matt
> > > > >
> > > > > On 8/25/05, Enrique Medina < e.medina.m@gmail.com> wrote:
> > > > > >
> > > > > > I have tried to define my properties file (resource bundle)
> > > > > > using Unicode encodings:
> > > > > >
> > > > > > combiVariables_ValidacionOK = La f\u00F3rmula es correcta
> > > > > > combiVariables_ValidacionNotOK = La f\u00F3rmula no es correcta
> > > > > >
> > > > > > But it still doesn't work :-(
> > > > > >
> > > > > > 2005/8/25, Enrique Medina <e.medina.m@gmail.com >:
> > > > > > >
> > > > > > > Thanks. Let me try it ;-)
> > > > > > >
> > > > > > > 2005/8/25, Matt Blum <mb...@gmail.com>:
> > > > > > > >
> > > > > > > > I understand that. I'm suggesting that, instead of "La
> > > > > > > > fórmula es correcta" in your properties file, you put "La
> > > > > > > > f\u00f3rmula es correcta."
> > > > > > > >
> > > > > > > > -Matt
> > > > > > > >
> > > > > > > > On 8/24/05, Enrique Medina <e.medina.m@gmail.com > wrote:
> > > > > > > > >
> > > > > > > > > Hi Matt,
> > > > > > > > >
> > > > > > > > > But the problem is that encoding is generated by JSF when
> > > > > > > > > using EL like this:
> > > > > > > > >
> > > > > > > > > #{messages.literal1}
> > > > > > > > >
> > > > > > > > > 2005/8/24, Matt Blum <mb...@gmail.com>:
> > > > > > > > > >
> > > > > > > > > > You need to use the Unicode encoding for the character,
> > > > > > > > > > like so:
> > > > > > > > > >
> > > > > > > > > > "La f\u00f3rmula es correcta"
> > > > > > > > > >
> > > > > > > > > > There's a handy online tool to find the codes for most
> > > > > > > > > > special characters here:
> > > > > > > > > >
> > > > > > > > > > http://www.saila.com/usage/tips/examples/special_characters.html
> > > > > > > > > >
> > > > > > > > > > -Matt
> > > > > > > > > >
> > > > > > > > > > On 8/24/05, Enrique Medina < e.medina.m@gmail.com >
> > > > > > > > > > wrote:
> > > > > > > > > > >
> > > > > > > > > > > Hi,
> > > > > > > > > > >
> > > > > > > > > > > I know this is not a question directly related with
> > > > > > > > > > > MyFaces, but does anybody knows how to solve this problem?
> > > > > > > > > > >
> > > > > > > > > > > I define my literal strings in a properties file, and
> > > > > > > > > > > then I have created a custom messages tag that renders the message as an
> > > > > > > > > > > alert of Javascript. So when a JSF message is generated, it is rendered as
> > > > > > > > > > > an alert. My problem is with accents. For example, in the alert window the
> > > > > > > > > > > text appears like:
> > > > > > > > > > >
> > > > > > > > > > > "La fórmula es correcta"
> > > > > > > > > > >
> > > > > > > > > > > while it should be:
> > > > > > > > > > >
> > > > > > > > > > > "La fórmula es correcta"
> > > > > > > > > > >
> > > > > > > > > > > Is it a matter of escaping the text in Javascript?
> > > > > > > > > > > Because I have tried the escape() function but with no success...
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Re: Spanish accents in Javascript
Posted by Enrique Medina <e....@gmail.com>.
Definitively, the problem is that the JSF ResponseWriter always encodes the
text generating &#-like strings.
So then a manual replace of these strings must be done within the javascript
section of the page :-(
2005/8/29, Enrique Medina <e....@gmail.com>:
>
> Hi again,
>
> I've been investigating this issue and the problem is here:
>
> HtmlResponseWriterImpl:
> ===================
> UnicodeEncoder.encode(strValue, false, false)
>
> All write methods use this call to the UnicodeEncoder, so the returned
> string always contains the ó or whatever.
>
> 2005/8/25, Matt Blum <mblum42@gmail.com >:
> >
> > Maybe the ConvertEncoding class in this article from OnJava.com would be
> > useful:
> >
> > http://www.onjava.com/pub/a/onjava/excerpt/javaexIAN3_chap8/index.html
> >
> > If not, it might at least give you an idea how to fix your issue.
> >
> > -Matt
> >
> >
> > On 8/25/05, Enrique Medina <e.medina.m@gmail.com > wrote:
> > >
> > > Hi Matt,
> > >
> > > Yes, the same thing occurs...
> > >
> > > 2005/8/25, Matt Blum < mblum42@gmail.com>:
> > > >
> > > > What does it do now? The same thing as before?
> > > >
> > > > -Matt
> > > >
> > > > On 8/25/05, Enrique Medina < e.medina.m@gmail.com> wrote:
> > > > >
> > > > > I have tried to define my properties file (resource bundle) using
> > > > > Unicode encodings:
> > > > >
> > > > > combiVariables_ValidacionOK = La f\u00F3rmula es correcta
> > > > > combiVariables_ValidacionNotOK = La f\u00F3rmula no es correcta
> > > > >
> > > > > But it still doesn't work :-(
> > > > >
> > > > > 2005/8/25, Enrique Medina <e.medina.m@gmail.com >:
> > > > > >
> > > > > > Thanks. Let me try it ;-)
> > > > > >
> > > > > > 2005/8/25, Matt Blum <mb...@gmail.com>:
> > > > > > >
> > > > > > > I understand that. I'm suggesting that, instead of "La fórmula
> > > > > > > es correcta" in your properties file, you put "La f\u00f3rmula
> > > > > > > es correcta."
> > > > > > >
> > > > > > > -Matt
> > > > > > >
> > > > > > > On 8/24/05, Enrique Medina <e.medina.m@gmail.com > wrote:
> > > > > > > >
> > > > > > > > Hi Matt,
> > > > > > > >
> > > > > > > > But the problem is that encoding is generated by JSF when
> > > > > > > > using EL like this:
> > > > > > > >
> > > > > > > > #{messages.literal1}
> > > > > > > >
> > > > > > > > 2005/8/24, Matt Blum <mb...@gmail.com>:
> > > > > > > > >
> > > > > > > > > You need to use the Unicode encoding for the character,
> > > > > > > > > like so:
> > > > > > > > >
> > > > > > > > > "La f\u00f3rmula es correcta"
> > > > > > > > >
> > > > > > > > > There's a handy online tool to find the codes for most
> > > > > > > > > special characters here:
> > > > > > > > >
> > > > > > > > > http://www.saila.com/usage/tips/examples/special_characters.html
> > > > > > > > >
> > > > > > > > > -Matt
> > > > > > > > >
> > > > > > > > > On 8/24/05, Enrique Medina < e.medina.m@gmail.com > wrote:
> > > > > > > > > >
> > > > > > > > > > Hi,
> > > > > > > > > >
> > > > > > > > > > I know this is not a question directly related with
> > > > > > > > > > MyFaces, but does anybody knows how to solve this problem?
> > > > > > > > > >
> > > > > > > > > > I define my literal strings in a properties file, and
> > > > > > > > > > then I have created a custom messages tag that renders the message as an
> > > > > > > > > > alert of Javascript. So when a JSF message is generated, it is rendered as
> > > > > > > > > > an alert. My problem is with accents. For example, in the alert window the
> > > > > > > > > > text appears like:
> > > > > > > > > >
> > > > > > > > > > "La fórmula es correcta"
> > > > > > > > > >
> > > > > > > > > > while it should be:
> > > > > > > > > >
> > > > > > > > > > "La fórmula es correcta"
> > > > > > > > > >
> > > > > > > > > > Is it a matter of escaping the text in Javascript?
> > > > > > > > > > Because I have tried the escape() function but with no success...
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Re: Spanish accents in Javascript
Posted by Enrique Medina <e....@gmail.com>.
Hi again,
I've been investigating this issue and the problem is here:
HtmlResponseWriterImpl:
===================
UnicodeEncoder.encode(strValue, false, false)
All write methods use this call to the UnicodeEncoder, so the returned
string always contains the ó or whatever.
2005/8/25, Matt Blum <mb...@gmail.com>:
>
> Maybe the ConvertEncoding class in this article from OnJava.com would be
> useful:
>
> http://www.onjava.com/pub/a/onjava/excerpt/javaexIAN3_chap8/index.html
>
> If not, it might at least give you an idea how to fix your issue.
>
> -Matt
>
>
> On 8/25/05, Enrique Medina <e....@gmail.com> wrote:
> >
> > Hi Matt,
> >
> > Yes, the same thing occurs...
> >
> > 2005/8/25, Matt Blum < mblum42@gmail.com>:
> > >
> > > What does it do now? The same thing as before?
> > >
> > > -Matt
> > >
> > > On 8/25/05, Enrique Medina < e.medina.m@gmail.com> wrote:
> > > >
> > > > I have tried to define my properties file (resource bundle) using
> > > > Unicode encodings:
> > > >
> > > > combiVariables_ValidacionOK = La f\u00F3rmula es correcta
> > > > combiVariables_ValidacionNotOK = La f\u00F3rmula no es correcta
> > > >
> > > > But it still doesn't work :-(
> > > >
> > > > 2005/8/25, Enrique Medina <e.medina.m@gmail.com >:
> > > > >
> > > > > Thanks. Let me try it ;-)
> > > > >
> > > > > 2005/8/25, Matt Blum <mb...@gmail.com>:
> > > > > >
> > > > > > I understand that. I'm suggesting that, instead of "La fórmula
> > > > > > es correcta" in your properties file, you put "La f\u00f3rmula
> > > > > > es correcta."
> > > > > >
> > > > > > -Matt
> > > > > >
> > > > > > On 8/24/05, Enrique Medina <e.medina.m@gmail.com > wrote:
> > > > > > >
> > > > > > > Hi Matt,
> > > > > > >
> > > > > > > But the problem is that encoding is generated by JSF when
> > > > > > > using EL like this:
> > > > > > >
> > > > > > > #{messages.literal1}
> > > > > > >
> > > > > > > 2005/8/24, Matt Blum <mb...@gmail.com>:
> > > > > > > >
> > > > > > > > You need to use the Unicode encoding for the character, like
> > > > > > > > so:
> > > > > > > >
> > > > > > > > "La f\u00f3rmula es correcta"
> > > > > > > >
> > > > > > > > There's a handy online tool to find the codes for most
> > > > > > > > special characters here:
> > > > > > > >
> > > > > > > > http://www.saila.com/usage/tips/examples/special_characters.html
> > > > > > > >
> > > > > > > > -Matt
> > > > > > > >
> > > > > > > > On 8/24/05, Enrique Medina < e.medina.m@gmail.com > wrote:
> > > > > > > > >
> > > > > > > > > Hi,
> > > > > > > > >
> > > > > > > > > I know this is not a question directly related with
> > > > > > > > > MyFaces, but does anybody knows how to solve this problem?
> > > > > > > > >
> > > > > > > > > I define my literal strings in a properties file, and then
> > > > > > > > > I have created a custom messages tag that renders the message as an alert of
> > > > > > > > > Javascript. So when a JSF message is generated, it is rendered as an alert.
> > > > > > > > > My problem is with accents. For example, in the alert window the text
> > > > > > > > > appears like:
> > > > > > > > >
> > > > > > > > > "La fórmula es correcta"
> > > > > > > > >
> > > > > > > > > while it should be:
> > > > > > > > >
> > > > > > > > > "La fórmula es correcta"
> > > > > > > > >
> > > > > > > > > Is it a matter of escaping the text in Javascript? Because
> > > > > > > > > I have tried the escape() function but with no success...
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Re: Spanish accents in Javascript
Posted by Matt Blum <mb...@gmail.com>.
Maybe the ConvertEncoding class in this article from OnJava.com would be
useful:
http://www.onjava.com/pub/a/onjava/excerpt/javaexIAN3_chap8/index.html
If not, it might at least give you an idea how to fix your issue.
-Matt
On 8/25/05, Enrique Medina <e....@gmail.com> wrote:
>
> Hi Matt,
>
> Yes, the same thing occurs...
>
> 2005/8/25, Matt Blum <mb...@gmail.com>:
> >
> > What does it do now? The same thing as before?
> >
> > -Matt
> >
> > On 8/25/05, Enrique Medina < e.medina.m@gmail.com> wrote:
> > >
> > > I have tried to define my properties file (resource bundle) using
> > > Unicode encodings:
> > >
> > > combiVariables_ValidacionOK = La f\u00F3rmula es correcta
> > > combiVariables_ValidacionNotOK = La f\u00F3rmula no es correcta
> > >
> > > But it still doesn't work :-(
> > >
> > > 2005/8/25, Enrique Medina <e.medina.m@gmail.com >:
> > > >
> > > > Thanks. Let me try it ;-)
> > > >
> > > > 2005/8/25, Matt Blum <mb...@gmail.com>:
> > > > >
> > > > > I understand that. I'm suggesting that, instead of "La fórmula es
> > > > > correcta" in your properties file, you put "La f\u00f3rmula es
> > > > > correcta."
> > > > >
> > > > > -Matt
> > > > >
> > > > > On 8/24/05, Enrique Medina <e.medina.m@gmail.com > wrote:
> > > > > >
> > > > > > Hi Matt,
> > > > > >
> > > > > > But the problem is that encoding is generated by JSF when using
> > > > > > EL like this:
> > > > > >
> > > > > > #{messages.literal1}
> > > > > >
> > > > > > 2005/8/24, Matt Blum <mb...@gmail.com>:
> > > > > > >
> > > > > > > You need to use the Unicode encoding for the character, like
> > > > > > > so:
> > > > > > >
> > > > > > > "La f\u00f3rmula es correcta"
> > > > > > >
> > > > > > > There's a handy online tool to find the codes for most special
> > > > > > > characters here:
> > > > > > >
> > > > > > > http://www.saila.com/usage/tips/examples/special_characters.html
> > > > > > >
> > > > > > > -Matt
> > > > > > >
> > > > > > > On 8/24/05, Enrique Medina < e.medina.m@gmail.com > wrote:
> > > > > > > >
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > I know this is not a question directly related with MyFaces,
> > > > > > > > but does anybody knows how to solve this problem?
> > > > > > > >
> > > > > > > > I define my literal strings in a properties file, and then I
> > > > > > > > have created a custom messages tag that renders the message as an alert of
> > > > > > > > Javascript. So when a JSF message is generated, it is rendered as an alert.
> > > > > > > > My problem is with accents. For example, in the alert window the text
> > > > > > > > appears like:
> > > > > > > >
> > > > > > > > "La fórmula es correcta"
> > > > > > > >
> > > > > > > > while it should be:
> > > > > > > >
> > > > > > > > "La fórmula es correcta"
> > > > > > > >
> > > > > > > > Is it a matter of escaping the text in Javascript? Because I
> > > > > > > > have tried the escape() function but with no success...
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Re: Spanish accents in Javascript
Posted by Enrique Medina <e....@gmail.com>.
Hi Matt,
Yes, the same thing occurs...
2005/8/25, Matt Blum <mb...@gmail.com>:
>
> What does it do now? The same thing as before?
>
> -Matt
>
> On 8/25/05, Enrique Medina <e....@gmail.com> wrote:
> >
> > I have tried to define my properties file (resource bundle) using
> > Unicode encodings:
> >
> > combiVariables_ValidacionOK = La f\u00F3rmula es correcta
> > combiVariables_ValidacionNotOK = La f\u00F3rmula no es correcta
> >
> > But it still doesn't work :-(
> >
> > 2005/8/25, Enrique Medina <e.medina.m@gmail.com >:
> > >
> > > Thanks. Let me try it ;-)
> > >
> > > 2005/8/25, Matt Blum <mb...@gmail.com>:
> > > >
> > > > I understand that. I'm suggesting that, instead of "La fórmula es
> > > > correcta" in your properties file, you put "La f\u00f3rmula es
> > > > correcta."
> > > >
> > > > -Matt
> > > >
> > > > On 8/24/05, Enrique Medina <e.medina.m@gmail.com > wrote:
> > > > >
> > > > > Hi Matt,
> > > > >
> > > > > But the problem is that encoding is generated by JSF when using EL
> > > > > like this:
> > > > >
> > > > > #{messages.literal1}
> > > > >
> > > > > 2005/8/24, Matt Blum <mb...@gmail.com>:
> > > > > >
> > > > > > You need to use the Unicode encoding for the character, like so:
> > > > > >
> > > > > > "La f\u00f3rmula es correcta"
> > > > > >
> > > > > > There's a handy online tool to find the codes for most special
> > > > > > characters here:
> > > > > > http://www.saila.com/usage/tips/examples/special_characters.html
> > > > > >
> > > > > > -Matt
> > > > > >
> > > > > > On 8/24/05, Enrique Medina < e.medina.m@gmail.com > wrote:
> > > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > I know this is not a question directly related with MyFaces,
> > > > > > > but does anybody knows how to solve this problem?
> > > > > > >
> > > > > > > I define my literal strings in a properties file, and then I
> > > > > > > have created a custom messages tag that renders the message as an alert of
> > > > > > > Javascript. So when a JSF message is generated, it is rendered as an alert.
> > > > > > > My problem is with accents. For example, in the alert window the text
> > > > > > > appears like:
> > > > > > >
> > > > > > > "La fórmula es correcta"
> > > > > > >
> > > > > > > while it should be:
> > > > > > >
> > > > > > > "La fórmula es correcta"
> > > > > > >
> > > > > > > Is it a matter of escaping the text in Javascript? Because I
> > > > > > > have tried the escape() function but with no success...
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Re: Spanish accents in Javascript
Posted by Matt Blum <mb...@gmail.com>.
What does it do now? The same thing as before?
-Matt
On 8/25/05, Enrique Medina <e....@gmail.com> wrote:
>
> I have tried to define my properties file (resource bundle) using Unicode
> encodings:
>
> combiVariables_ValidacionOK = La f\u00F3rmula es correcta
> combiVariables_ValidacionNotOK = La f\u00F3rmula no es correcta
>
> But it still doesn't work :-(
>
> 2005/8/25, Enrique Medina <e....@gmail.com>:
> >
> > Thanks. Let me try it ;-)
> >
> > 2005/8/25, Matt Blum <mb...@gmail.com>:
> > >
> > > I understand that. I'm suggesting that, instead of "La fórmula es
> > > correcta" in your properties file, you put "La f\u00f3rmula es
> > > correcta."
> > >
> > > -Matt
> > >
> > > On 8/24/05, Enrique Medina <e.medina.m@gmail.com > wrote:
> > > >
> > > > Hi Matt,
> > > >
> > > > But the problem is that encoding is generated by JSF when using EL
> > > > like this:
> > > >
> > > > #{messages.literal1}
> > > >
> > > > 2005/8/24, Matt Blum <mb...@gmail.com>:
> > > > >
> > > > > You need to use the Unicode encoding for the character, like so:
> > > > >
> > > > > "La f\u00f3rmula es correcta"
> > > > >
> > > > > There's a handy online tool to find the codes for most special
> > > > > characters here:
> > > > > http://www.saila.com/usage/tips/examples/special_characters.html
> > > > >
> > > > > -Matt
> > > > >
> > > > > On 8/24/05, Enrique Medina < e.medina.m@gmail.com > wrote:
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > I know this is not a question directly related with MyFaces, but
> > > > > > does anybody knows how to solve this problem?
> > > > > >
> > > > > > I define my literal strings in a properties file, and then I
> > > > > > have created a custom messages tag that renders the message as an alert of
> > > > > > Javascript. So when a JSF message is generated, it is rendered as an alert.
> > > > > > My problem is with accents. For example, in the alert window the text
> > > > > > appears like:
> > > > > >
> > > > > > "La fórmula es correcta"
> > > > > >
> > > > > > while it should be:
> > > > > >
> > > > > > "La fórmula es correcta"
> > > > > >
> > > > > > Is it a matter of escaping the text in Javascript? Because I
> > > > > > have tried the escape() function but with no success...
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Re: Spanish accents in Javascript
Posted by Enrique Medina <e....@gmail.com>.
I have tried to define my properties file (resource bundle) using Unicode
encodings:
combiVariables_ValidacionOK = La f\u00F3rmula es correcta
combiVariables_ValidacionNotOK = La f\u00F3rmula no es correcta
But it still doesn't work :-(
2005/8/25, Enrique Medina <e....@gmail.com>:
>
> Thanks. Let me try it ;-)
>
> 2005/8/25, Matt Blum <mb...@gmail.com>:
> >
> > I understand that. I'm suggesting that, instead of "La fórmula es
> > correcta" in your properties file, you put "La f\u00f3rmula es
> > correcta."
> >
> > -Matt
> >
> > On 8/24/05, Enrique Medina <e.medina.m@gmail.com > wrote:
> > >
> > > Hi Matt,
> > >
> > > But the problem is that encoding is generated by JSF when using EL
> > > like this:
> > >
> > > #{messages.literal1}
> > >
> > > 2005/8/24, Matt Blum <mb...@gmail.com>:
> > > >
> > > > You need to use the Unicode encoding for the character, like so:
> > > >
> > > > "La f\u00f3rmula es correcta"
> > > >
> > > > There's a handy online tool to find the codes for most special
> > > > characters here:
> > > > http://www.saila.com/usage/tips/examples/special_characters.html
> > > >
> > > > -Matt
> > > >
> > > > On 8/24/05, Enrique Medina < e.medina.m@gmail.com > wrote:
> > > > >
> > > > > Hi,
> > > > >
> > > > > I know this is not a question directly related with MyFaces, but
> > > > > does anybody knows how to solve this problem?
> > > > >
> > > > > I define my literal strings in a properties file, and then I have
> > > > > created a custom messages tag that renders the message as an alert of
> > > > > Javascript. So when a JSF message is generated, it is rendered as an alert.
> > > > > My problem is with accents. For example, in the alert window the text
> > > > > appears like:
> > > > >
> > > > > "La fórmula es correcta"
> > > > >
> > > > > while it should be:
> > > > >
> > > > > "La fórmula es correcta"
> > > > >
> > > > > Is it a matter of escaping the text in Javascript? Because I have
> > > > > tried the escape() function but with no success...
> > > > >
> > > > >
> > > >
> > >
> >
>
Re: Spanish accents in Javascript
Posted by Enrique Medina <e....@gmail.com>.
Thanks. Let me try it ;-)
2005/8/25, Matt Blum <mb...@gmail.com>:
>
> I understand that. I'm suggesting that, instead of "La fórmula es
> correcta" in your properties file, you put "La f\u00f3rmula es correcta."
>
> -Matt
>
> On 8/24/05, Enrique Medina <e....@gmail.com> wrote:
> >
> > Hi Matt,
> >
> > But the problem is that encoding is generated by JSF when using EL like
> > this:
> >
> > #{messages.literal1}
> >
> > 2005/8/24, Matt Blum <mb...@gmail.com>:
> > >
> > > You need to use the Unicode encoding for the character, like so:
> > >
> > > "La f\u00f3rmula es correcta"
> > >
> > > There's a handy online tool to find the codes for most special
> > > characters here:
> > > http://www.saila.com/usage/tips/examples/special_characters.html
> > >
> > > -Matt
> > >
> > > On 8/24/05, Enrique Medina < e.medina.m@gmail.com > wrote:
> > > >
> > > > Hi,
> > > >
> > > > I know this is not a question directly related with MyFaces, but
> > > > does anybody knows how to solve this problem?
> > > >
> > > > I define my literal strings in a properties file, and then I have
> > > > created a custom messages tag that renders the message as an alert of
> > > > Javascript. So when a JSF message is generated, it is rendered as an alert.
> > > > My problem is with accents. For example, in the alert window the text
> > > > appears like:
> > > >
> > > > "La fórmula es correcta"
> > > >
> > > > while it should be:
> > > >
> > > > "La fórmula es correcta"
> > > >
> > > > Is it a matter of escaping the text in Javascript? Because I have
> > > > tried the escape() function but with no success...
> > > >
> > > >
> > >
> >
>
Re: Spanish accents in Javascript
Posted by Matt Blum <mb...@gmail.com>.
I understand that. I'm suggesting that, instead of "La fórmula es correcta"
in your properties file, you put "La f\u00f3rmula es correcta."
-Matt
On 8/24/05, Enrique Medina <e....@gmail.com> wrote:
>
> Hi Matt,
>
> But the problem is that encoding is generated by JSF when using EL like
> this:
>
> #{messages.literal1}
>
> 2005/8/24, Matt Blum <mb...@gmail.com>:
> >
> > You need to use the Unicode encoding for the character, like so:
> >
> > "La f\u00f3rmula es correcta"
> >
> > There's a handy online tool to find the codes for most special
> > characters here:
> > http://www.saila.com/usage/tips/examples/special_characters.html
> >
> > -Matt
> >
> > On 8/24/05, Enrique Medina < e.medina.m@gmail.com > wrote:
> > >
> > > Hi,
> > >
> > > I know this is not a question directly related with MyFaces, but does
> > > anybody knows how to solve this problem?
> > >
> > > I define my literal strings in a properties file, and then I have
> > > created a custom messages tag that renders the message as an alert of
> > > Javascript. So when a JSF message is generated, it is rendered as an alert.
> > > My problem is with accents. For example, in the alert window the text
> > > appears like:
> > >
> > > "La fórmula es correcta"
> > >
> > > while it should be:
> > >
> > > "La fórmula es correcta"
> > >
> > > Is it a matter of escaping the text in Javascript? Because I have
> > > tried the escape() function but with no success...
> > >
> > >
> >
>
Re: Spanish accents in Javascript
Posted by Enrique Medina <e....@gmail.com>.
Hi Matt,
But the problem is that encoding is generated by JSF when using EL like
this:
#{messages.literal1}
2005/8/24, Matt Blum <mb...@gmail.com>:
>
> You need to use the Unicode encoding for the character, like so:
>
> "La f\u00f3rmula es correcta"
>
> There's a handy online tool to find the codes for most special characters
> here:
> http://www.saila.com/usage/tips/examples/special_characters.html
>
> -Matt
>
> On 8/24/05, Enrique Medina <e.medina.m@gmail.com > wrote:
> >
> > Hi,
> >
> > I know this is not a question directly related with MyFaces, but does
> > anybody knows how to solve this problem?
> >
> > I define my literal strings in a properties file, and then I have
> > created a custom messages tag that renders the message as an alert of
> > Javascript. So when a JSF message is generated, it is rendered as an alert.
> > My problem is with accents. For example, in the alert window the text
> > appears like:
> >
> > "La fórmula es correcta"
> >
> > while it should be:
> >
> > "La fórmula es correcta"
> >
> > Is it a matter of escaping the text in Javascript? Because I have tried
> > the escape() function but with no success...
> >
> >
>
Re: Spanish accents in Javascript
Posted by Matt Blum <mb...@gmail.com>.
You need to use the Unicode encoding for the character, like so:
"La f\u00f3rmula es correcta"
There's a handy online tool to find the codes for most special characters
here:
http://www.saila.com/usage/tips/examples/special_characters.html
-Matt
On 8/24/05, Enrique Medina <e....@gmail.com> wrote:
>
> Hi,
>
> I know this is not a question directly related with MyFaces, but does
> anybody knows how to solve this problem?
>
> I define my literal strings in a properties file, and then I have created
> a custom messages tag that renders the message as an alert of Javascript. So
> when a JSF message is generated, it is rendered as an alert. My problem is
> with accents. For example, in the alert window the text appears like:
>
> "La fórmula es correcta"
>
> while it should be:
>
> "La fórmula es correcta"
>
> Is it a matter of escaping the text in Javascript? Because I have tried
> the escape() function but with no success...
>
>