develooper Front page | perl.macosx | Postings from July 2001

Re: Accented characters in scripts (and whereis iconv.h?)

Thread Previous | Thread Next
From:
Christian Smith
Date:
July 23, 2001 07:14
Subject:
Re: Accented characters in scripts (and whereis iconv.h?)
Message ID:
20010723101415-r01010700-3f8b990e-0910-0108@63.49.91.75
On Monday, July 23, 2001 at 09:33, steve@justclick.net (Steve Torrence) wrote:

> I would just like to know what is the most common way of handling 
> this. It's hard to believe the Perl script authors working on 
> scripts for languages that contain these extended characters are 
> going through a lot of trouble putting the accented characters in 
> their scripts. It seems that a tool like bbedit would be able to 
> take a script that was written using the extended characters and 
> convert the text to something compatible with perl.

The way I see it, you have three options. I've listed them in what I would
think of as increasing order to desirability.

1) Add a content-type meta tag like this

<meta http-equiv="content-type" content="text/html; charset=x-mac-roman">

which will tell the browser to treat the text as MacRoman. This will cause
the text to render properly in any browser which can handle the conversion
correctly.


2) Save the files in ISO Latin-1 encoding and convert to/from MacRoamn as
necessary when editing. You'll need something like the Midex plug-in for
BBEdit to do the character set conversions.

<http://www.barebones.com/support/bbedit/bbedit-plugins.html>


3) Convert the 8bit characters in your files to HTML entity codes. That
is, é becomes &eacute; etc. You can use the Translate command in BBEdit to
do this. (Markup:Utilities:Translate)


Actually, there is another option. You could write the script in MacRoman
and then, before spitting out the HTML, convert the text to ISO Latin-1 on
the fly. I guess I'd place this somewhere between 2 and 3 above.

-- 
Christian Smith  |  csmith@barebones.com  |  http://web.barebones.com

He who dies with the most friends... Is still dead!

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About