Re: AutoCompleteTextField and accentuated characters

2009-03-24 Thread Thierry Leveque
Ok, I fixed my problem. I should say I patched it! And it is pretty ugly

The problem is from the fact that on the client side the ajax get URI is
encoded from as utf-8. But the default Tomcat's URIEncoding is ISO-8859-1
and for me it is something I cannot change.
So when Tomcat is receiving the request it try to decode the parameters as
if they are ISO-8859-1 and the result is not what is expected.
If I look at the request.getQueryString, the encoding is fine but not with
getParameter(String).

So my patch is to convert the ISO-8859-1 string to UTF-8 inside my
getChoices method:
*input = new String(input.getBytes(ISO-8859-1),UTF-8);*

It is a patch but at least it is working fine now.

Any better idea?

Thierry


On Mon, Mar 23, 2009 at 21:05, Thierry Leveque tleve...@gmail.com wrote:

 Well I was still perplex, because other fields, and even other ajax
 components seems to work fine with the default Tomcat config.
 So I used the Firefox extension TamperData to see exactly what is sent by
 the browser.
 The difference is obvious: Other ajax components and normal submit link are
 doing a post to the server. So the request object in the Wicket filter
 contain the correct decoded value. This is what I especting.
 But when using the AutoCompleteTextField it is a get that is used!!
 The value is then send directly within the url. And this is probably why it
 is not encoded/decoded correctly.

 But why is this ajax component is doing a get and the others are doing
 posts??
 An idea??

 Thierry



 On Mon, Mar 23, 2009 at 20:15, mbrictson m...@55minutes.com wrote:


 I checked the Tomcat source code and the default URIEncoding is ISO-8859-1
 (not the system default encoding as I previously stated).

 AFAIK it is a global setting; I don't think you can set it per web
 application.

 If you don't have access to change the URIEncoding in the server.xml, then
 perhaps your only option is to build your Wicket application using
 ISO-8859-1 instead of UTF-8.

 --
 Matt


 tleveque wrote:
 
  It is working!!! Thanks!!!
 
  But I hope this is standard on Linux server, because I don't think I
 will
  have access that on the server where I am hosting my web site.
 
  Do you know if there is another way to set that per web application?
 
  Thanks again!
 
  Thierry
 
  Sent from: Montreal Quebec Canada.
 
  On Mon, Mar 23, 2009 at 16:37, mbrictson m...@55minutes.com wrote:
 
 
  Are you using Tomcat?
 
  I had a similar problem (with the word café specifically) and it turned
  out
  to be caused by Tomcat's URL encoding. By default, Tomcat uses the
 system
  encoding for URLs. You will have to edit the Tomcat configuration to
  change
  this:
 
  1. Open $CATALINA_HOME/conf/server.xml
 
  2. Locate the Connector that is being used. If you are accessing
 Tomcat
directly, this will be the HTTP/1.1 connector. If you have Tomcat
  fronted
  by
Apache HTTPd, this will be the AJP connector. If in doubt, edit both.
 
  3. Add the attribute: URIEncoding=UTF-8.
 
  Example:
 
  Connector port=8080 protocol=HTTP/1.1
connectionTimeout=2
redirectPort=8443
URIEncoding=UTF-8 /
 
  --
  Matt
 
 
  tleveque wrote:
  
   Hi,
  
   I have a problem AutoCompleteTextField and accentuated characters.
 When
  I
   type characters within the us-ascii set, there is no problem, but as
  soon
   as I use other characters (like 'é'), it doesn't work. The wrong
  character
   is received.
   With the Ajax debugger I can see that what is sent is wrong (or maybe
   encoded?). For a 'é', it sends is '%C3%A9'. That what is received as
  the
   parameter of the getChoices method.
  
   Is there something I can do about that?
   I am using Wicket 1.3.5
  
   Thanks...
  
 
  --
  View this message in context:
 
 http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22668559.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22672081.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





Re: AutoCompleteTextField and accentuated characters

2009-03-24 Thread Maarten Bosteels
try calling this method as early as possible 9eg with a servlet filter):
http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#setCharacterEncoding(java.lang.String)

see also:
http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/web/filter/CharacterEncodingFilter.html

Maarten

On Tue, Mar 24, 2009 at 6:41 PM, Thierry Leveque tleve...@gmail.com wrote:

 Ok, I fixed my problem. I should say I patched it! And it is pretty
 ugly

 The problem is from the fact that on the client side the ajax get URI is
 encoded from as utf-8. But the default Tomcat's URIEncoding is ISO-8859-1
 and for me it is something I cannot change.
 So when Tomcat is receiving the request it try to decode the parameters as
 if they are ISO-8859-1 and the result is not what is expected.
 If I look at the request.getQueryString, the encoding is fine but not with
 getParameter(String).

 So my patch is to convert the ISO-8859-1 string to UTF-8 inside my
 getChoices method:
 *input = new String(input.getBytes(ISO-8859-1),UTF-8);*

 It is a patch but at least it is working fine now.

 Any better idea?

 Thierry


 On Mon, Mar 23, 2009 at 21:05, Thierry Leveque tleve...@gmail.com wrote:

  Well I was still perplex, because other fields, and even other ajax
  components seems to work fine with the default Tomcat config.
  So I used the Firefox extension TamperData to see exactly what is sent by
  the browser.
  The difference is obvious: Other ajax components and normal submit link
 are
  doing a post to the server. So the request object in the Wicket filter
  contain the correct decoded value. This is what I especting.
  But when using the AutoCompleteTextField it is a get that is used!!
  The value is then send directly within the url. And this is probably why
 it
  is not encoded/decoded correctly.
 
  But why is this ajax component is doing a get and the others are doing
  posts??
  An idea??
 
  Thierry
 
 
 
  On Mon, Mar 23, 2009 at 20:15, mbrictson m...@55minutes.com wrote:
 
 
  I checked the Tomcat source code and the default URIEncoding is
 ISO-8859-1
  (not the system default encoding as I previously stated).
 
  AFAIK it is a global setting; I don't think you can set it per web
  application.
 
  If you don't have access to change the URIEncoding in the server.xml,
 then
  perhaps your only option is to build your Wicket application using
  ISO-8859-1 instead of UTF-8.
 
  --
  Matt
 
 
  tleveque wrote:
  
   It is working!!! Thanks!!!
  
   But I hope this is standard on Linux server, because I don't think I
  will
   have access that on the server where I am hosting my web site.
  
   Do you know if there is another way to set that per web application?
  
   Thanks again!
  
   Thierry
  
   Sent from: Montreal Quebec Canada.
  
   On Mon, Mar 23, 2009 at 16:37, mbrictson m...@55minutes.com wrote:
  
  
   Are you using Tomcat?
  
   I had a similar problem (with the word café specifically) and it
 turned
   out
   to be caused by Tomcat's URL encoding. By default, Tomcat uses the
  system
   encoding for URLs. You will have to edit the Tomcat configuration to
   change
   this:
  
   1. Open $CATALINA_HOME/conf/server.xml
  
   2. Locate the Connector that is being used. If you are accessing
  Tomcat
 directly, this will be the HTTP/1.1 connector. If you have Tomcat
   fronted
   by
 Apache HTTPd, this will be the AJP connector. If in doubt, edit
 both.
  
   3. Add the attribute: URIEncoding=UTF-8.
  
   Example:
  
   Connector port=8080 protocol=HTTP/1.1
 connectionTimeout=2
 redirectPort=8443
 URIEncoding=UTF-8 /
  
   --
   Matt
  
  
   tleveque wrote:
   
Hi,
   
I have a problem AutoCompleteTextField and accentuated characters.
  When
   I
type characters within the us-ascii set, there is no problem, but
 as
   soon
as I use other characters (like 'é'), it doesn't work. The wrong
   character
is received.
With the Ajax debugger I can see that what is sent is wrong (or
 maybe
encoded?). For a 'é', it sends is '%C3%A9'. That what is received
 as
   the
parameter of the getChoices method.
   
Is there something I can do about that?
I am using Wicket 1.3.5
   
Thanks...
   
  
   --
   View this message in context:
  
 
 http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22668559.html
   Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
  
  
 
  --
  View this message in context:
 
 http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22672081.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe

Re: AutoCompleteTextField and accentuated characters

2009-03-23 Thread Michael Sparer

it isn't the 'wrong character' it's é in UTF8 which is perfectly fine -so you
end up with an é at the end of the line - so what's the problem again? :-)

regards,
Michael


tleveque wrote:
 
 Hi,
 
 I have a problem AutoCompleteTextField and accentuated characters. When I
 type characters within the us-ascii set, there is no problem, but as soon
 as I use other characters (like 'é'), it doesn't work. The wrong character
 is received.
 With the Ajax debugger I can see that what is sent is wrong (or maybe
 encoded?). For a 'é', it sends is '%C3%A9'. That what is received as the
 parameter of the getChoices method.
 
 Is there something I can do about that?
 I am using Wicket 1.3.5
 
 Thanks...
 


-
Michael Sparer
http://techblog.molindo.at
-- 
View this message in context: 
http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22661278.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: AutoCompleteTextField and accentuated characters

2009-03-23 Thread Thierry Leveque
The problem is that with any other form fields, what is saved in my models
is fine. All the accentuated characters are fine. If I output (in a log file
for example) the content of a string field, I can see the accentuated
character.
But with the AutocompleteTextField, if I try to do that in the getChoice
method, the input parameter output is still encoded. So I am unable to
compare the string with what I have in my db.

You say that it is actually UTF-8 in the request. Good that is what I
thought first, but why in the java code it is not interpreted correctly?
From what I remember, Java string are always in UTF-8. No?

Thierry


On Mon, Mar 23, 2009 at 10:30, Michael Sparer michael.spa...@gmx.at wrote:


 it isn't the 'wrong character' it's é in UTF8 which is perfectly fine -so
 you
 end up with an é at the end of the line - so what's the problem again? :-)

 regards,
 Michael


 tleveque wrote:
 
  Hi,
 
  I have a problem AutoCompleteTextField and accentuated characters. When I
  type characters within the us-ascii set, there is no problem, but as soon
  as I use other characters (like 'é'), it doesn't work. The wrong
 character
  is received.
  With the Ajax debugger I can see that what is sent is wrong (or maybe
  encoded?). For a 'é', it sends is '%C3%A9'. That what is received as the
  parameter of the getChoices method.
 
  Is there something I can do about that?
  I am using Wicket 1.3.5
 
  Thanks...
 


 -
 Michael Sparer
 http://techblog.molindo.at
 --
 View this message in context:
 http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22661278.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: AutoCompleteTextField and accentuated characters

2009-03-23 Thread Michael Sparer

i can't reproduce your problem, if I send café up to the server caf%C3%A9
gets send and I receive café at the end of the line ...



tleveque wrote:
 
 The problem is that with any other form fields, what is saved in my models
 is fine. All the accentuated characters are fine. If I output (in a log
 file
 for example) the content of a string field, I can see the accentuated
 character.
 But with the AutocompleteTextField, if I try to do that in the getChoice
 method, the input parameter output is still encoded. So I am unable to
 compare the string with what I have in my db.
 
 You say that it is actually UTF-8 in the request. Good that is what I
 thought first, but why in the java code it is not interpreted correctly?
 From what I remember, Java string are always in UTF-8. No?
 
 Thierry
 
 
 On Mon, Mar 23, 2009 at 10:30, Michael Sparer michael.spa...@gmx.at
 wrote:
 

 it isn't the 'wrong character' it's é in UTF8 which is perfectly fine -so
 you
 end up with an é at the end of the line - so what's the problem again?
 :-)

 regards,
 Michael


 tleveque wrote:
 
  Hi,
 
  I have a problem AutoCompleteTextField and accentuated characters. When
 I
  type characters within the us-ascii set, there is no problem, but as
 soon
  as I use other characters (like 'é'), it doesn't work. The wrong
 character
  is received.
  With the Ajax debugger I can see that what is sent is wrong (or maybe
  encoded?). For a 'é', it sends is '%C3%A9'. That what is received as
 the
  parameter of the getChoices method.
 
  Is there something I can do about that?
  I am using Wicket 1.3.5
 
  Thanks...
 


 -
 Michael Sparer
 http://techblog.molindo.at
 --
 View this message in context:
 http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22661278.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org


 
 


-
Michael Sparer
http://techblog.molindo.at
-- 
View this message in context: 
http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22662019.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: AutoCompleteTextField and accentuated characters

2009-03-23 Thread Thierry Leveque
Using Wicket 1.3.5?

Mmmm, I will have to get the source code and check what is happening. Maybe
it have something to do with the fact that I am under Mac OS X? But if it
was the case, why all other fields are ok?
I think I will also try with another ajax component.

Thierry
Sent from: Montreal Quebec Canada.

On Mon, Mar 23, 2009 at 11:07, Michael Sparer michael.spa...@gmx.at wrote:


 i can't reproduce your problem, if I send café up to the server caf%C3%A9
 gets send and I receive café at the end of the line ...



 tleveque wrote:
 
  The problem is that with any other form fields, what is saved in my
 models
  is fine. All the accentuated characters are fine. If I output (in a log
  file
  for example) the content of a string field, I can see the accentuated
  character.
  But with the AutocompleteTextField, if I try to do that in the
 getChoice
  method, the input parameter output is still encoded. So I am unable
 to
  compare the string with what I have in my db.
 
  You say that it is actually UTF-8 in the request. Good that is what I
  thought first, but why in the java code it is not interpreted correctly?
  From what I remember, Java string are always in UTF-8. No?
 
  Thierry
 
 
  On Mon, Mar 23, 2009 at 10:30, Michael Sparer michael.spa...@gmx.at
  wrote:
 
 
  it isn't the 'wrong character' it's é in UTF8 which is perfectly fine
 -so
  you
  end up with an é at the end of the line - so what's the problem again?
  :-)
 
  regards,
  Michael
 
 
  tleveque wrote:
  
   Hi,
  
   I have a problem AutoCompleteTextField and accentuated characters.
 When
  I
   type characters within the us-ascii set, there is no problem, but as
  soon
   as I use other characters (like 'é'), it doesn't work. The wrong
  character
   is received.
   With the Ajax debugger I can see that what is sent is wrong (or maybe
   encoded?). For a 'é', it sends is '%C3%A9'. That what is received as
  the
   parameter of the getChoices method.
  
   Is there something I can do about that?
   I am using Wicket 1.3.5
  
   Thanks...
  
 
 
  -
  Michael Sparer
  http://techblog.molindo.at
  --
  View this message in context:
 
 http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22661278.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 


 -
 Michael Sparer
 http://techblog.molindo.at
 --
 View this message in context:
 http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22662019.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: AutoCompleteTextField and accentuated characters

2009-03-23 Thread Marcelo Morales
This may be a stupid answer, but every time I hear something like
this, I turn to the usual suspect: bad enconding on source files or
the web page itself.
Make sure EVERYTHING is properly encoded UTF-8 and not Mac Roman or
ISO-8859-1 and not a mix.

On Mon, Mar 23, 2009 at 11:33 AM, Thierry Leveque tleve...@gmail.com wrote:
 Using Wicket 1.3.5?

 Mmmm, I will have to get the source code and check what is happening. Maybe
 it have something to do with the fact that I am under Mac OS X? But if it
 was the case, why all other fields are ok?
 I think I will also try with another ajax component.

 Thierry
 Sent from: Montreal Quebec Canada.

 On Mon, Mar 23, 2009 at 11:07, Michael Sparer michael.spa...@gmx.at wrote:


 i can't reproduce your problem, if I send café up to the server caf%C3%A9
 gets send and I receive café at the end of the line ...



 tleveque wrote:
 
  The problem is that with any other form fields, what is saved in my
 models
  is fine. All the accentuated characters are fine. If I output (in a log
  file
  for example) the content of a string field, I can see the accentuated
  character.
  But with the AutocompleteTextField, if I try to do that in the
 getChoice
  method, the input parameter output is still encoded. So I am unable
 to
  compare the string with what I have in my db.
 
  You say that it is actually UTF-8 in the request. Good that is what I
  thought first, but why in the java code it is not interpreted correctly?
  From what I remember, Java string are always in UTF-8. No?
 
  Thierry
 
 
  On Mon, Mar 23, 2009 at 10:30, Michael Sparer michael.spa...@gmx.at
  wrote:
 
 
  it isn't the 'wrong character' it's é in UTF8 which is perfectly fine
 -so
  you
  end up with an é at the end of the line - so what's the problem again?
  :-)
 
  regards,
  Michael
 
 
  tleveque wrote:
  
   Hi,
  
   I have a problem AutoCompleteTextField and accentuated characters.
 When
  I
   type characters within the us-ascii set, there is no problem, but as
  soon
   as I use other characters (like 'é'), it doesn't work. The wrong
  character
   is received.
   With the Ajax debugger I can see that what is sent is wrong (or maybe
   encoded?). For a 'é', it sends is '%C3%A9'. That what is received as
  the
   parameter of the getChoices method.
  
   Is there something I can do about that?
   I am using Wicket 1.3.5
  
   Thanks...
  
 
 
  -
  Michael Sparer
  http://techblog.molindo.at
  --
  View this message in context:
 
 http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22661278.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 


 -
 Michael Sparer
 http://techblog.molindo.at
 --
 View this message in context:
 http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22662019.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org






-- 
Marcelo Morales

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: AutoCompleteTextField and accentuated characters

2009-03-23 Thread Thierry Leveque
Thanks. I think everything is fine. At least on the markup side.
...
meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
...
form id=form1 wicket:id=form1 name=form1 method=post action=
enctype=UTF-8

Is there something I need to set on the code side?

Thierry

Sent from: Montreal Quebec Canada.

On Mon, Mar 23, 2009 at 12:00, Marcelo Morales marcelomorales.name@
gmail.com wrote:

 This may be a stupid answer, but every time I hear something like
 this, I turn to the usual suspect: bad enconding on source files or
 the web page itself.
 Make sure EVERYTHING is properly encoded UTF-8 and not Mac Roman or
 ISO-8859-1 and not a mix.

 On Mon, Mar 23, 2009 at 11:33 AM, Thierry Leveque tleve...@gmail.com
 wrote:
  Using Wicket 1.3.5?
 
  Mmmm, I will have to get the source code and check what is happening.
 Maybe
  it have something to do with the fact that I am under Mac OS X? But if it
  was the case, why all other fields are ok?
  I think I will also try with another ajax component.
 
  Thierry
  Sent from: Montreal Quebec Canada.
 
  On Mon, Mar 23, 2009 at 11:07, Michael Sparer michael.spa...@gmx.at
 wrote:
 
 
  i can't reproduce your problem, if I send café up to the server
 caf%C3%A9
  gets send and I receive café at the end of the line ...
 
 
 
  tleveque wrote:
  
   The problem is that with any other form fields, what is saved in my
  models
   is fine. All the accentuated characters are fine. If I output (in a
 log
   file
   for example) the content of a string field, I can see the accentuated
   character.
   But with the AutocompleteTextField, if I try to do that in the
  getChoice
   method, the input parameter output is still encoded. So I am
 unable
  to
   compare the string with what I have in my db.
  
   You say that it is actually UTF-8 in the request. Good that is what I
   thought first, but why in the java code it is not interpreted
 correctly?
   From what I remember, Java string are always in UTF-8. No?
  
   Thierry
  
  
   On Mon, Mar 23, 2009 at 10:30, Michael Sparer michael.spa...@gmx.at
   wrote:
  
  
   it isn't the 'wrong character' it's é in UTF8 which is perfectly fine
  -so
   you
   end up with an é at the end of the line - so what's the problem
 again?
   :-)
  
   regards,
   Michael
  
  
   tleveque wrote:
   
Hi,
   
I have a problem AutoCompleteTextField and accentuated characters.
  When
   I
type characters within the us-ascii set, there is no problem, but
 as
   soon
as I use other characters (like 'é'), it doesn't work. The wrong
   character
is received.
With the Ajax debugger I can see that what is sent is wrong (or
 maybe
encoded?). For a 'é', it sends is '%C3%A9'. That what is received
 as
   the
parameter of the getChoices method.
   
Is there something I can do about that?
I am using Wicket 1.3.5
   
Thanks...
   
  
  
   -
   Michael Sparer
   http://techblog.molindo.at
   --
   View this message in context:
  
 
 http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22661278.html
   Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
  
  
 
 
  -
  Michael Sparer
  http://techblog.molindo.at
  --
  View this message in context:
 
 http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22662019.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 



 --
 Marcelo Morales

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: AutoCompleteTextField and accentuated characters

2009-03-23 Thread Marcelo Morales
Thierry

Meta tags?, don't know about that. Have you seen the Content-type
header on the HTTP response?
What about the choices source for your autocompleter?. Is it in proper
UTF-8 encoded?.
What about -encoding flag passed to javac or
encodingUTF-8/encoding on
artifactIdmaven-compiler-plugin/artifactId?

On Mon, Mar 23, 2009 at 1:05 PM, Thierry Leveque tleve...@gmail.com wrote:
 Thanks. I think everything is fine. At least on the markup side.
 ...
 meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
 ...
 form id=form1 wicket:id=form1 name=form1 method=post action=
 enctype=UTF-8

 Is there something I need to set on the code side?

 Thierry

 Sent from: Montreal Quebec Canada.

 On Mon, Mar 23, 2009 at 12:00, Marcelo Morales marcelomorales.name@
 gmail.com wrote:

 This may be a stupid answer, but every time I hear something like
 this, I turn to the usual suspect: bad enconding on source files or
 the web page itself.
 Make sure EVERYTHING is properly encoded UTF-8 and not Mac Roman or
 ISO-8859-1 and not a mix.

 On Mon, Mar 23, 2009 at 11:33 AM, Thierry Leveque tleve...@gmail.com
 wrote:
  Using Wicket 1.3.5?
 
  Mmmm, I will have to get the source code and check what is happening.
 Maybe
  it have something to do with the fact that I am under Mac OS X? But if it
  was the case, why all other fields are ok?
  I think I will also try with another ajax component.
 
  Thierry
  Sent from: Montreal Quebec Canada.
 
  On Mon, Mar 23, 2009 at 11:07, Michael Sparer michael.spa...@gmx.at
 wrote:
 
 
  i can't reproduce your problem, if I send café up to the server
 caf%C3%A9
  gets send and I receive café at the end of the line ...
 
 
 
  tleveque wrote:
  
   The problem is that with any other form fields, what is saved in my
  models
   is fine. All the accentuated characters are fine. If I output (in a
 log
   file
   for example) the content of a string field, I can see the accentuated
   character.
   But with the AutocompleteTextField, if I try to do that in the
  getChoice
   method, the input parameter output is still encoded. So I am
 unable
  to
   compare the string with what I have in my db.
  
   You say that it is actually UTF-8 in the request. Good that is what I
   thought first, but why in the java code it is not interpreted
 correctly?
   From what I remember, Java string are always in UTF-8. No?
  
   Thierry
  
  
   On Mon, Mar 23, 2009 at 10:30, Michael Sparer michael.spa...@gmx.at
   wrote:
  
  
   it isn't the 'wrong character' it's é in UTF8 which is perfectly fine
  -so
   you
   end up with an é at the end of the line - so what's the problem
 again?
   :-)
  
   regards,
   Michael
  
  
   tleveque wrote:
   
Hi,
   
I have a problem AutoCompleteTextField and accentuated characters.
  When
   I
type characters within the us-ascii set, there is no problem, but
 as
   soon
as I use other characters (like 'é'), it doesn't work. The wrong
   character
is received.
With the Ajax debugger I can see that what is sent is wrong (or
 maybe
encoded?). For a 'é', it sends is '%C3%A9'. That what is received
 as
   the
parameter of the getChoices method.
   
Is there something I can do about that?
I am using Wicket 1.3.5
   
Thanks...
   
  
  
   -
   Michael Sparer
   http://techblog.molindo.at
   --
   View this message in context:
  
 
 http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22661278.html
   Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
  
  
 
 
  -
  Michael Sparer
  http://techblog.molindo.at
  --
  View this message in context:
 
 http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22662019.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 



 --
 Marcelo Morales

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org






-- 
Marcelo Morales

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: AutoCompleteTextField and accentuated characters

2009-03-23 Thread Marcelo Morales
BTW it still may be a stupid answer.

On Mon, Mar 23, 2009 at 2:25 PM, Marcelo Morales
marcelomorales.n...@gmail.com wrote:
 Thierry

 Meta tags?, don't know about that. Have you seen the Content-type
 header on the HTTP response?
 What about the choices source for your autocompleter?. Is it in proper
 UTF-8 encoded?.
 What about -encoding flag passed to javac or
 encodingUTF-8/encoding on
 artifactIdmaven-compiler-plugin/artifactId?

 On Mon, Mar 23, 2009 at 1:05 PM, Thierry Leveque tleve...@gmail.com wrote:
 Thanks. I think everything is fine. At least on the markup side.
 ...
 meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
 ...
 form id=form1 wicket:id=form1 name=form1 method=post action=
 enctype=UTF-8

 Is there something I need to set on the code side?

 Thierry

 Sent from: Montreal Quebec Canada.

 On Mon, Mar 23, 2009 at 12:00, Marcelo Morales marcelomorales.name@
 gmail.com wrote:

 This may be a stupid answer, but every time I hear something like
 this, I turn to the usual suspect: bad enconding on source files or
 the web page itself.
 Make sure EVERYTHING is properly encoded UTF-8 and not Mac Roman or
 ISO-8859-1 and not a mix.

 On Mon, Mar 23, 2009 at 11:33 AM, Thierry Leveque tleve...@gmail.com
 wrote:
  Using Wicket 1.3.5?
 
  Mmmm, I will have to get the source code and check what is happening.
 Maybe
  it have something to do with the fact that I am under Mac OS X? But if it
  was the case, why all other fields are ok?
  I think I will also try with another ajax component.
 
  Thierry
  Sent from: Montreal Quebec Canada.
 
  On Mon, Mar 23, 2009 at 11:07, Michael Sparer michael.spa...@gmx.at
 wrote:
 
 
  i can't reproduce your problem, if I send café up to the server
 caf%C3%A9
  gets send and I receive café at the end of the line ...
 
 
 
  tleveque wrote:
  
   The problem is that with any other form fields, what is saved in my
  models
   is fine. All the accentuated characters are fine. If I output (in a
 log
   file
   for example) the content of a string field, I can see the accentuated
   character.
   But with the AutocompleteTextField, if I try to do that in the
  getChoice
   method, the input parameter output is still encoded. So I am
 unable
  to
   compare the string with what I have in my db.
  
   You say that it is actually UTF-8 in the request. Good that is what I
   thought first, but why in the java code it is not interpreted
 correctly?
   From what I remember, Java string are always in UTF-8. No?
  
   Thierry
  
  
   On Mon, Mar 23, 2009 at 10:30, Michael Sparer michael.spa...@gmx.at
   wrote:
  
  
   it isn't the 'wrong character' it's é in UTF8 which is perfectly fine
  -so
   you
   end up with an é at the end of the line - so what's the problem
 again?
   :-)
  
   regards,
   Michael
  
  
   tleveque wrote:
   
Hi,
   
I have a problem AutoCompleteTextField and accentuated characters.
  When
   I
type characters within the us-ascii set, there is no problem, but
 as
   soon
as I use other characters (like 'é'), it doesn't work. The wrong
   character
is received.
With the Ajax debugger I can see that what is sent is wrong (or
 maybe
encoded?). For a 'é', it sends is '%C3%A9'. That what is received
 as
   the
parameter of the getChoices method.
   
Is there something I can do about that?
I am using Wicket 1.3.5
   
Thanks...
   
  
  
   -
   Michael Sparer
   http://techblog.molindo.at
   --
   View this message in context:
  
 
 http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22661278.html
   Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
  
  
 
 
  -
  Michael Sparer
  http://techblog.molindo.at
  --
  View this message in context:
 
 http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22662019.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 



 --
 Marcelo Morales

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org






 --
 Marcelo Morales




-- 
Marcelo Morales

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: AutoCompleteTextField and accentuated characters

2009-03-23 Thread mbrictson

Are you using Tomcat?

I had a similar problem (with the word café specifically) and it turned out
to be caused by Tomcat's URL encoding. By default, Tomcat uses the system
encoding for URLs. You will have to edit the Tomcat configuration to change
this:

1. Open $CATALINA_HOME/conf/server.xml

2. Locate the Connector that is being used. If you are accessing Tomcat
   directly, this will be the HTTP/1.1 connector. If you have Tomcat fronted
by
   Apache HTTPd, this will be the AJP connector. If in doubt, edit both.
   
3. Add the attribute: URIEncoding=UTF-8.

Example:

Connector port=8080 protocol=HTTP/1.1 
   connectionTimeout=2 
   redirectPort=8443
   URIEncoding=UTF-8 /

--
Matt


tleveque wrote:
 
 Hi,
 
 I have a problem AutoCompleteTextField and accentuated characters. When I
 type characters within the us-ascii set, there is no problem, but as soon
 as I use other characters (like 'é'), it doesn't work. The wrong character
 is received.
 With the Ajax debugger I can see that what is sent is wrong (or maybe
 encoded?). For a 'é', it sends is '%C3%A9'. That what is received as the
 parameter of the getChoices method.
 
 Is there something I can do about that?
 I am using Wicket 1.3.5
 
 Thanks...
 

-- 
View this message in context: 
http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22668559.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: AutoCompleteTextField and accentuated characters

2009-03-23 Thread Thierry Leveque
It is working!!! Thanks!!!

But I hope this is standard on Linux server, because I don't think I will
have access that on the server where I am hosting my web site.

Do you know if there is another way to set that per web application?

Thanks again!

Thierry

Sent from: Montreal Quebec Canada.

On Mon, Mar 23, 2009 at 16:37, mbrictson m...@55minutes.com wrote:


 Are you using Tomcat?

 I had a similar problem (with the word café specifically) and it turned out
 to be caused by Tomcat's URL encoding. By default, Tomcat uses the system
 encoding for URLs. You will have to edit the Tomcat configuration to change
 this:

 1. Open $CATALINA_HOME/conf/server.xml

 2. Locate the Connector that is being used. If you are accessing Tomcat
   directly, this will be the HTTP/1.1 connector. If you have Tomcat fronted
 by
   Apache HTTPd, this will be the AJP connector. If in doubt, edit both.

 3. Add the attribute: URIEncoding=UTF-8.

 Example:

 Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443
   URIEncoding=UTF-8 /

 --
 Matt


 tleveque wrote:
 
  Hi,
 
  I have a problem AutoCompleteTextField and accentuated characters. When I
  type characters within the us-ascii set, there is no problem, but as soon
  as I use other characters (like 'é'), it doesn't work. The wrong
 character
  is received.
  With the Ajax debugger I can see that what is sent is wrong (or maybe
  encoded?). For a 'é', it sends is '%C3%A9'. That what is received as the
  parameter of the getChoices method.
 
  Is there something I can do about that?
  I am using Wicket 1.3.5
 
  Thanks...
 

 --
 View this message in context:
 http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22668559.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: AutoCompleteTextField and accentuated characters

2009-03-23 Thread mbrictson

I checked the Tomcat source code and the default URIEncoding is ISO-8859-1
(not the system default encoding as I previously stated).

AFAIK it is a global setting; I don't think you can set it per web
application.

If you don't have access to change the URIEncoding in the server.xml, then
perhaps your only option is to build your Wicket application using
ISO-8859-1 instead of UTF-8.

--
Matt


tleveque wrote:
 
 It is working!!! Thanks!!!
 
 But I hope this is standard on Linux server, because I don't think I will
 have access that on the server where I am hosting my web site.
 
 Do you know if there is another way to set that per web application?
 
 Thanks again!
 
 Thierry
 
 Sent from: Montreal Quebec Canada.
 
 On Mon, Mar 23, 2009 at 16:37, mbrictson m...@55minutes.com wrote:
 

 Are you using Tomcat?

 I had a similar problem (with the word café specifically) and it turned
 out
 to be caused by Tomcat's URL encoding. By default, Tomcat uses the system
 encoding for URLs. You will have to edit the Tomcat configuration to
 change
 this:

 1. Open $CATALINA_HOME/conf/server.xml

 2. Locate the Connector that is being used. If you are accessing Tomcat
   directly, this will be the HTTP/1.1 connector. If you have Tomcat
 fronted
 by
   Apache HTTPd, this will be the AJP connector. If in doubt, edit both.

 3. Add the attribute: URIEncoding=UTF-8.

 Example:

 Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443
   URIEncoding=UTF-8 /

 --
 Matt


 tleveque wrote:
 
  Hi,
 
  I have a problem AutoCompleteTextField and accentuated characters. When
 I
  type characters within the us-ascii set, there is no problem, but as
 soon
  as I use other characters (like 'é'), it doesn't work. The wrong
 character
  is received.
  With the Ajax debugger I can see that what is sent is wrong (or maybe
  encoded?). For a 'é', it sends is '%C3%A9'. That what is received as
 the
  parameter of the getChoices method.
 
  Is there something I can do about that?
  I am using Wicket 1.3.5
 
  Thanks...
 

 --
 View this message in context:
 http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22668559.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org


 
 

-- 
View this message in context: 
http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22672081.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: AutoCompleteTextField and accentuated characters

2009-03-23 Thread Thierry Leveque
Well I was still perplex, because other fields, and even other ajax
components seems to work fine with the default Tomcat config.
So I used the Firefox extension TamperData to see exactly what is sent by
the browser.
The difference is obvious: Other ajax components and normal submit link are
doing a post to the server. So the request object in the Wicket filter
contain the correct decoded value. This is what I especting.
But when using the AutoCompleteTextField it is a get that is used!!
The value is then send directly within the url. And this is probably why it
is not encoded/decoded correctly.

But why is this ajax component is doing a get and the others are doing
posts??
An idea??

Thierry


On Mon, Mar 23, 2009 at 20:15, mbrictson m...@55minutes.com wrote:


 I checked the Tomcat source code and the default URIEncoding is ISO-8859-1
 (not the system default encoding as I previously stated).

 AFAIK it is a global setting; I don't think you can set it per web
 application.

 If you don't have access to change the URIEncoding in the server.xml, then
 perhaps your only option is to build your Wicket application using
 ISO-8859-1 instead of UTF-8.

 --
 Matt


 tleveque wrote:
 
  It is working!!! Thanks!!!
 
  But I hope this is standard on Linux server, because I don't think I will
  have access that on the server where I am hosting my web site.
 
  Do you know if there is another way to set that per web application?
 
  Thanks again!
 
  Thierry
 
  Sent from: Montreal Quebec Canada.
 
  On Mon, Mar 23, 2009 at 16:37, mbrictson m...@55minutes.com wrote:
 
 
  Are you using Tomcat?
 
  I had a similar problem (with the word café specifically) and it turned
  out
  to be caused by Tomcat's URL encoding. By default, Tomcat uses the
 system
  encoding for URLs. You will have to edit the Tomcat configuration to
  change
  this:
 
  1. Open $CATALINA_HOME/conf/server.xml
 
  2. Locate the Connector that is being used. If you are accessing
 Tomcat
directly, this will be the HTTP/1.1 connector. If you have Tomcat
  fronted
  by
Apache HTTPd, this will be the AJP connector. If in doubt, edit both.
 
  3. Add the attribute: URIEncoding=UTF-8.
 
  Example:
 
  Connector port=8080 protocol=HTTP/1.1
connectionTimeout=2
redirectPort=8443
URIEncoding=UTF-8 /
 
  --
  Matt
 
 
  tleveque wrote:
  
   Hi,
  
   I have a problem AutoCompleteTextField and accentuated characters.
 When
  I
   type characters within the us-ascii set, there is no problem, but as
  soon
   as I use other characters (like 'é'), it doesn't work. The wrong
  character
   is received.
   With the Ajax debugger I can see that what is sent is wrong (or maybe
   encoded?). For a 'é', it sends is '%C3%A9'. That what is received as
  the
   parameter of the getChoices method.
  
   Is there something I can do about that?
   I am using Wicket 1.3.5
  
   Thanks...
  
 
  --
  View this message in context:
 
 http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22668559.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22672081.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




AutoCompleteTextField and accentuated characters

2009-03-21 Thread tleveque

Hi,

I have a problem AutoCompleteTextField and accentuated characters. When I
type characters within the us-ascii set, there is no problem, but as soon as
I use other characters (like 'é'), it doesn't work. The wrong character is
received.
With the Ajax debugger I can see that what is sent is wrong (or maybe
encoded?). For a 'é', it sends is '%C3%A9'. That what is received as the
parameter of the getChoices method.

Is there something I can do about that?
I am using Wicket 1.3.5

Thanks...
-- 
View this message in context: 
http://www.nabble.com/AutoCompleteTextField-and-accentuated-characters-tp22637037p22637037.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org