Javascript Popup Menu help?
October 28, 2005 8:09 PM   Subscribe

A work friend is going nuts trying to finish a website and is stuck on a javascript popup menu problem. Characters look different when he uploads them to his server. Help?

Using Dreamweaver MX 2004, Mac OS X, when characters in words such as "calÇado" and "acessÓrios" are used in the popup menu (which is in portuguese), they appear messed up (or different) once uploaded to his server. Any idea what may be causing this or how to fix it? If the Dreamweaver popup menu is the problem, is there an alternative (preferably very easy and free)? I'm obviously unable to help to him as I have no idea. If anyone may suggest a decent popup menu, javascript or otherwise it would be fantastic.
posted by ig to Computers & Internet (12 answers total)
 
My guess is that somewhere along the line unicode characters are getting mangled. Certanly macromedia has not been the best about this, as evidenced by all the problems we've had hear (using JRun).

My recomendation is that he replace his text with HTML entities. So 'calÇado' would be come "calÇado" which looks like 'calÇado'. You can find a list of HTML entities here. The Ó thing is Ó
posted by delmoi at 8:19 PM on October 28, 2005


wow, that actualy posted properly.
posted by delmoi at 8:19 PM on October 28, 2005


Sounds like a server encoding problem. Make sure the Content-Type header has the correct charset parameter.
posted by cillit bang at 8:26 PM on October 28, 2005


Response by poster: cillit bang, what should the correct charset parameter be in this case?
posted by ig at 8:43 PM on October 28, 2005


You should really know that. Try utf-8 or iso-8859-1, they're the most common.
posted by cillit bang at 8:52 PM on October 28, 2005


The correct encoding depends on how the characters are encoded in your html. Seriously, there's no way to tell without knowing that. It could be UTF-8, or it could be Windows CP-1252, or it could be something else. Most browsers have some ability to auto-detect this, but it looks like they aren't smart enough to look at the encodings of the contents of javascript variables.
posted by Rhomboid at 10:58 PM on October 28, 2005


You could try putting character set meta tags into the <HEAD> section of the HTML page. Without knowing what character set Dreamweaver is using it will be trial and error, but the likelihood is that it's UTF-8. If you post a screenshot of what they're output as, maybe I'll be able to tell, I've seen enough character encoding issues over the years to sometimes be able to tell when characters in one character set are being interpreted as if they were using a different character set.
For UTF-8...
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
If that doesn't work, try...
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

Also, I know nothing about Dreamweaver, but try looking for a character set setting. If Dreamweaver is clever, it will output characters in that character set, and put the appropriate meta tags at the top of the outputted HTML page.
posted by chill at 6:04 AM on October 29, 2005


Response by poster: If you look here, where
it says "CORPO", the special characters just don't appear. If you look here,
still on "CORPO" on the menu, they appear messed up. Tried changing charsets
on Dreamweaver, but still can't get the characters to display properly. cillit
bang, pardon my ignorance, I am just trying to help a co-worker.
posted by ig at 8:07 AM on October 29, 2005


The first of those pages is declared as character set iso-8859-1.
The second is declared as UTF-8.
Neither shows the correct characters in the browser

This tells us that either you are using a third as yet unkown character set, or the page declared as UTF-8 is encoded in iso-8859-1, and vise-versa. So try swapping the tags round so that the first is declared as UTF-8, the second iso-8859-1 and see what happens.

If I was at work on my PC, I'd be able to load the source in a text editor that has a hex view on it, and thus be able to see the actual numbers used to encode the letters, and determine the character set. However, I'm at home on my MAC, and I don't know how to configure my MAC to do that, so unless someone else can tell me how, I can't be of much more help I'm afraid.
posted by chill at 8:52 AM on October 29, 2005


Ooops, got it the wrong way round.
The first of those pages is declared as character set UTF-8.
The second is declared as iso-8859-1.
So try swapping the tags round so that the first is declared as iso-88590-1, the second UTF-8 and see what happens.
posted by chill at 8:54 AM on October 29, 2005


You might try uploading in BINARY mode (or in ASCII mode if you already are).
posted by Boo! at 3:53 PM on October 29, 2005


Neither document appears to be in an encoding I'm familiar with. It's certainly not UTF-8 or ISO-8859-1. I think they've been mangled while you were trying to sort out the problem.

At this point I'd recommend putting thie string in Javascript as 'Cal'+fromCharCode(199)+'ados'.

(I didn't mean to call you ignorant. But really your co-worker should have chosen a character set to work in before they started)
posted by cillit bang at 5:30 AM on October 30, 2005


« Older What should I take with me as a Red Cross...   |   acupuncture for dogs Newer »
This thread is closed to new comments.