logo       

Re: [FormBuilder] Using UTF-8 templates in CGI::FB: msg#00013

Subject: Re: [FormBuilder] Using UTF-8 templates in CGI::FB
Can't speak to the FB message handling, because we bypass it in
favor of templatized Locale::Maketext calls, but one thing to check is
whether you are setting the HTML page's content type to indicate
that the charset is utf-8. You can set it in the HTTP Content-Type
header or as a meta-equiv tag in the HTML itself, but you need to
get that done.

In general you shouldn't need "use utf8" as long as you've got
a reasonably recent Perl (5.8, not 5.6). Beyond that I'm not sure
what else to check -- we have got this kind of thing working reasonably
well but not with Template Toolkit, not FB's own layout.

HTH,

Rod

José Parrella wrote:
> 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
> 
_______________________________________________
FBusers mailing list
FBusers@xxxxxxxxxxxxxxx
http://www.formbuilder.org/mailman/listinfo/fbusers
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe