View Full Version : Small problem with charset/encoding etc.

09-25-2008, 08:32 AM
I'm not the brightest at javascript, so no hard feelings if I really don't know what I'm talking about.

I had this really small task to do a messenger or something similar. A simple thing where you have a textarea (where you type your mail) and a button to send it.
Most of it works fine.
Exept, in my language we have letters like , , their in charset=iso-8859-1. And the problem there is, if the person writes the message in the textarea it's all fine, but when this person hits the send button the extra 4 letters are concerted into something like this: õäöü
And the second thing is that there's a god damn = mark in front of the text also, what I'm not able to get rid of.

<script language="JavaScript">
function msg() {
document.mailer.action = "mailto:"
mailtoandsubject = ((document.mailer.mailtoperson.options[document.mailer.mailtoperson.selectedIndex].value) + '?subject=' + document.mailer.subject.value);
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<th valign="top" width="698" scope="col">
<form name="mailer" method="post" action="mailto:xxxxxx@xxxxx.xx" enctype="text/plain"
onSubmit="(document.mailer.action += mailtoandsubject)">
<table border=0 width="100%">
<tr valgin="top" align="centre">
<textarea name="" cols=45 rows=5 wrap="virtual" OnChange="msg(this.form)">
<td><input type="submit" value="Saada kiri">
<input type="reset" value="Thjenda"></td>

Any ideas/help/ a new mailer would be much needed ;)

09-25-2008, 08:44 AM
in javascript I do:

textToSend = encodeURIComponent("č ....other strange characters");

how to stick it in your code, have no idea.