From: Kutter M. <mar...@si...> - 2004-09-08 10:06:31
|
Hi Andreas, This looks like the default solution. Unfortunately, = SPOPS::Tool::UTFConvert always assumes iso-8859-a (Latin1) as originating charset, which is not neccessarily true. So, this does not work for charsets other than Latin1. The ability to = grab the charset from the request in conjunction with a slightly modified SPOPS::Tool::UTFConvert ( use the request's charset, if given) would = remove the problem completely. Regards, Martin Kutter -----Original Message----- From: ope...@li... [mailto:ope...@li...]On Behalf Of And...@Be... Sent: Mittwoch, 8. September 2004 11:53 To: ope...@li... Subject: AW: [Openinteract-dev] Small i18n issue Hi Martin, We had the same problem with reading Umlaut characters with LDAP for = the user names. You can solve this by adding the following to the = spops.perl file of the package in question: rules_from =3D> [ 'SPOPS::Tool::UTFConvert' ], Hope that helped... Mit freundlichen Gr=FC=DFen Andreas Nolte=20 Leitung IT ------------------------------------------------- arvato direct services Olympiastra=DFe 1 26419 Schortens Germany http://www.arvato.com/ and...@be... Telefon +49 (0) 44 21 - 76-84002 Telefax +49 (0) 44 21 - 76-84111 -----Urspr=FCngliche Nachricht----- Von: ope...@li... [mailto:ope...@li...]=20 Gesendet: Mittwoch, 8. September 2004 11:33 An: 'ope...@li...' Betreff: [Openinteract-dev] Small i18n issue Hi * ! I ran into a small internationalization issue, today.=20 I'm running a OI2 site with SPOPS::LDAP as backend. On storing = non-ASCII characters in the LDAP directory server, this complains that properties = with non-ASCII-characters have an "invalid syntax". I've been able to track this down to a charset problem.=20 LDAP expects directoryString attributes to be in UTF-8 encoding. The perl-ldap interface (Net::LDAP) does not provide UTF-8 conversions by default, so these are to be done by the application using Net::LDAP. = This is no big deal - just a=20 use Encode; $value =3D decode($charset, $value); for all the fields to set - but one needs to know the request's = charset. The charset used in the HTTP request is specified by the "charset" = attribute in the Content-Type header.=20 Example: Content-Type: multipart/formdata; boundary=3D"--------------12345"; charset=3D"EUC-JP" The default is "iso-8859-1" if no charset is supplied.=20 The problem is, that the only available solution to get the charset = used in the request is to grab it from the underlying Apache::Request or CGI::Request handle - not really easy and not really portable: my $contentHeader =3D CTX->request->apache->headers_in()->{ = Content-Type }; As different charsets in HTTP requests are very likely to happen in = i18n'ed environments, and the problem is very likely to occur in non-LDAP environments, too, I would suggest an extension to the OpenInteract2::Request class, that provides access to the Content-Type = HTTP header, like it already does with some other header fields. Maybe even a more general approach - exposing all HTTP headers in the request object - could be suitable: This would remove the need to react = on additional HTTP headers by code changes forever. Regards, Martin Kutter ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=3D5047&alloc_id=3D10808&op=3Dclick _______________________________________________ openinteract-dev mailing list ope...@li... https://lists.sourceforge.net/lists/listinfo/openinteract-dev ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_idP47&alloc_id=10808&op=3Dclick _______________________________________________ openinteract-dev mailing list ope...@li... https://lists.sourceforge.net/lists/listinfo/openinteract-dev |