Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Small problem with charset/encoding etc.

    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.

    Code:
    <head>
    <script language="JavaScript">
    function msg() {
    document.mailer.action = "mailto:" 
    mailtoandsubject = ((document.mailer.mailtoperson.options[document.mailer.mailtoperson.selectedIndex].value) + '?subject=' + document.mailer.subject.value); 
    } 
    </script> 
    <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">
    <td>
    <textarea name="" cols=45 rows=5 wrap="virtual" OnChange="msg(this.form)">
    </textarea>
    </td>
    </tr>
    <tr>
    <td><input type="submit" value="Saada kiri">
    <input type="reset" value="TŘhjenda"></td>
    </tr>
    </table>
    </form>
    Any ideas/help/ a new mailer would be much needed

  • #2
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,979
    Thanks
    120
    Thanked 76 Times in 76 Posts
    in javascript I do:

    Code:
    textToSend = encodeURIComponent("čÜ× ....other strange characters");
    how to stick it in your code, have no idea.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •