From: Wolfgang M. <wol...@ex...> - 2004-02-16 13:36:42
|
Thanks. I commited some additional modifications to XQueryServlet: passed=20 request parameters were always transcoded to the servlet engine's default=20 encoding (ISO-8859-1), though the browser sent them in correct UTF-8. This= =20 makes all queries fail. I modified HttpRequestWrapper to recode the passed parameter back into the= =20 original encoding used by the form. Following Cocoon's example, there are n= ow=20 two additional servlet parameters in web.xml: form-encoding and=20 container-encoding. form-encoding specifies the character encoding used by= =20 the client web-browser, container-encoding defines the encoding used by the= =20 servlet engine. If form-encoding and container-encoding differ, the=20 HttpRequestWrapper will recode all parameters from container-encoding to=20 form-encoding. =46or example, if your HTML form posts UTF-8 encoded parameters, the follow= ing=20 configuration for XQueryServlet should work: <init-param> <param-name>form-encoding</param-name> <param-value>UTF-8</param-value> </init-param> <init-param> <param-name>container-encoding</param-name> <param-value>ISO-8859-1</param-value> </init-param> Wolfgang On Monday 16 February 2004 12:04, Jean-Marc Vanel wrote: > OK, I commited : > > org/exist/http/servlets/XQueryServlet.java > webapp/WEB-INF/web.xml > > I suggest that you use eclipse to edit the source file updates because > your editor introduced differences in empty lines, which is not clean > when doing CVS commits. > > Le 02/15/2004 10:36 AM, Marcus Andersson a =E9crit : > > Jean-Marc Vanel wrote: > >> Fine! If you send me your modifications, i can commit it in CVS. > > > > You can find the file attached. The changes made are: > > > > 1. Added final static String DEFAULT_ENCODING =3D "UTF-8" where the > > other default values are > > > > 2. Added a private String encoding member where the other members are > > > > 3. Added initializing of encoding member in init and sets it to > > DEFAULT_ENCODING if there is no init_parameter named encoding > > > > 4. Changed use of hard coded value "UTF-8" in readQuery() to use > > member encoding instead > > > > Pretty straight forward things and I tried to adhere to the style of > > the old code. > > > > /Marcus > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=3D1356&alloc_id=3D3438&op=3Dclick > _______________________________________________ > Exist-open mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-open |