Forum Moderators: coopster & phranque

Message Too Old, No Replies

Accented characters in email

Can anyone explain?

         

transistor

6:27 pm on Mar 25, 2003 (gmt 0)

10+ Year Member



In a web-based email script I use, I send characters used in spanish: áéíóúñ¿¡ü.
The body of the message is assigned within the script: $message .= "Tu contraseña"; (your password)
I created this script on a Mac with OS X and BBEdit.
When uploaded and viewed with Pico on the server (OpenBSD) it looks something like this: "Tu contrase?a".
And of course, when the message is recieved the ñ does not show correctly.
BBEdit shows me that the ASCII code of the ñ is 150.

Whoever, if I send in the email an accented character (taken from MySQL, previously inputted on the same Mac) it shows correctly.

In Mail app of the Mac I did a View>Show>Raw Source and then when Option-Click (or right-button click) on the message, selected "Show Control Characters" I can see a representation of these special characters (I'm ignorant here, I don't know what kind of representation is it).

Then I found out that, for example, ñ is \361.
When I substituted the ñ in the previous message like this: $message .= "Tu contrase\361a"; the ñ showed up just fine in the email!

My question is why? What is 361? ASCII? or what?
Why is it on the Mac a different character?
Yeah, I know, I fixed it, but I would like to know what is going on.
Thanks.

(If this post does not belong to this forum, please move to the proper one)

DrDoc

6:53 pm on Mar 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Pure ascii is characters 0-127. So, it might help to include which character set you're using. ISO-8859-1 works...

ñ = character 241, not 150

\361 is octal for 241 .. That's why it works :)

You can also encode it ñ or ñ

transistor

3:33 am on Mar 27, 2003 (gmt 0)

10+ Year Member



Thank you DrDoc.
:)