Help: Accented characters

They have: 5,633 posts

Joined: Jan 1970

Can you help me please?

If accented characters are entered in a form what encoding is used to represent them in JavaScript and in the cgi which processes the form?

Does this vary depending on the character set chosen in
the browser? Does it vary platform to platform or browser to browser at all?

Is there is any way to force a particular encoding to be used in both JavaScript and in the posted data?

Thanks in advance.

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi Melanie,

if by "accented" you mean grave, etc: I'm not sure (never having dealt with it and presuming the language meta tag would take care of it automatically). However, javascript does have two built-in encoding functions: escape() / unescape().

var encodedString = escape(fieldName.value);
var unencodedString = unescape(encodedString);

Hope this helps. If not, let me know

Vinny

Where the world once stood
the blades of grass cut me still

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi,

You might also want to see this thread:

http://freewarejava.com/ubb/Forum2/HTML/002565.html
while not directly related to your problem, it does talk about non-English characters.

Vinny

Where the world once stood
the blades of grass cut me still

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.