10 Feb 23:28
[FormBuilder] Using UTF-8 templates in CGI::FB
From: José Parrella <joseparrella <at> gmail.com>
Subject: [FormBuilder] Using UTF-8 templates in CGI::FB
Newsgroups: gmane.comp.lang.perl.modules.formbuilder
Date: 2007-02-10 22:31:20 GMT
Subject: [FormBuilder] Using UTF-8 templates in CGI::FB
Newsgroups: gmane.comp.lang.perl.modules.formbuilder
Date: 2007-02-10 22:31:20 GMT
Greetings, I've been developing a UTF-8 based Web application in spanish (es_ES) with CGI::FormBuilder, which already provides templates for this language. However, I get weird characters in all JS messages, as well as errors from the W3C Validator. Please note that I'm not an expert in this topic, but I think I've narrowed the problem to: a) The es_ES.pm messages file is encoded in ISO-8859-1 (I opened it with a UTF-8 aware text editor and rewrote it, then checked it with `file es_ES.pm` which says that now it is a UTF-8 file) b) The functions in FormBuilder.pm that write the actual JavaScript code are using "return <string>", and this last step is not UTF-8 aware (I don't know why, though). If I add "use Encode;" and then return encode_utf8(<string>); I get the proper code in the HTML output. Also, most scripts I checked in were not using "use utf8;". I don't know if this is mandatory of if it actually helps with something, but just in case. Can somebody explain to me a proper way to do UTF-8 based forms with sane characters in the JS alerts and so on? Jose -- -- José M. Parrella -> Debian Sid, k2.6.18 Escuela de Ingenieria Electrica Universidad Central de Venezuela -> ucvlug.info _______________________________________________ FBusers mailing list(Continue reading)
RSS Feed