In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Steve Torrence) wrote:

> So what I'm doing is taking prewritten scripts like YaBB (forum 
> software) and using it for the Brazilian language which has many 
> characters such as ���� etc.
> 
> In the scripts that I have received that already have these 
> extended ascii characters I noticed that they don't contain the 
> actual character but a replacement character but when the script is 
> run and it outputs the html to the browser it shows the correct 
> character. So what I have been doing is just looking for the word I 
> want like Voc� in one of these prewritten scripts to see what 
> character � needs to be so that it displays � and I just 
> copy/paste. For example in a perl script � needs to be entered as 
> Voc�. If this gets garbled in transmission, what I'm referring to 
> is the e with the ^ over it and in perl it needs to be entered as a 
> capital I with a right slanting accent.
> 
> I just know there must be an easier way to do this instead of 
> remembering and typing all these substitute characters.

This "replacement" you are describing is what I have been talking about.  
A capital I with an acute accent is the same byte in MacRoman as a 
lowercase e with a circumflex.  Your problem is just that you are using 
two different character sets.

If you are outputting to HTML, the Right Way to do it is to either type 
the characters using the correct HTML Entities, or type them using 
Latin-1 and encode them before output using the function 
HTML::Entities::encode_entities().  It is usually best to keep it in 
Latin-1 and the encode into HTML, or, if necessary, encode into MacRoman 
(if outputting to something that is not HTML).

I personally never bother with such conversions, if I know the output is 
going to be HTML.  I just store it using the correct HTML entities (like 
"&ecirc;").  If you know the output is HTML, then use HTML, which means 
using the HTML entities, not the Latin-1 or MacRoman characters.

-- 
Chris Nandor                      [EMAIL PROTECTED]    http://pudge.net/
Open Source Development Network    [EMAIL PROTECTED]     http://osdn.com/

Reply via email to