Alpha Video Training
Results 1 to 8 of 8

Thread: Email special characters

  1. #1
    Member
    Real Name
    pieter cremers
    Join Date
    Nov 2009
    Location
    Netherlands
    Posts
    146

    Default Email special characters

    Hi all,

    I am using alpha to send emails from a database.
    In the database there is a text field that contains html. So that the user gets "html" mail.
    This works ok with one exception.
    If there are special characters like é or û in the text then the mailrecipient sees something very different.
    for example à instead of é

    If I display this text field in a browser then you see the correct characters (html memo display).

    I have tried a few things like adding a header
    pm.Headers = alltrim(str("Content-Type: text/html; charset=\"UTF-8\""))
    but unfortunately the original header is also in the resulting mail whith charset ="us-asci"

    I have also tried to htmlencode and base64encode the text but that doesnt help either :(

    Anybody any idea in which direction I have to look for a solution?


    tia

    Pieter Cremers

  2. #2
    Member Chris.Tanti's Avatar
    Real Name
    Chris Tanti
    Join Date
    May 2000
    Location
    Cardiff, South Wales, UK
    Posts
    368

    Default Re: Email special characters

    Hi,

    I am sure others could come up with a more elegant solution, but the following could work.
    Just drop the text into a variable and then use STRTRAN_MULTI()
    replacing the
    é with é
    û with û
    etc.

    This site should give most of teh codes

    http://ascii.cl/htmlcodes.htm

  3. #3
    Member
    Real Name
    pieter cremers
    Join Date
    Nov 2009
    Location
    Netherlands
    Posts
    146

    Default Re: Email special characters

    Hi Chris

    Thank you very much.
    I got it working using this function to replace the special characters.

    Pieter

  4. #4
    "Certified" Alphaholic Clipper87's Avatar
    Real Name
    Frank
    Join Date
    Dec 2008
    Location
    Antwerp, Belgium
    Posts
    1,891

    Default Re: Email special characters

    Pieter,

    Take a look at the html_escape function:

    ? html_escape("entrée") = = "entrée"
    Frank

    Tell me and I'll forget; show me and I may remember; involve me and I'll understand

  5. #5
    Member
    Real Name
    pieter cremers
    Join Date
    Nov 2009
    Location
    Netherlands
    Posts
    146

    Default Re: Email special characters

    Hi Frank,

    The html_escape and htmlencode functions are to good :)
    They not only replace é but also < and " etc. and then <html>blabla</html> is no longer recognized as htmlmail. But it is plain text. Which doesnt look ok in the email client.


    thanks for the help

    Pieter

  6. #6
    Member tekri's Avatar
    Real Name
    Alexander Krišš
    Join Date
    Oct 2010
    Location
    Bratislava, Slovakia
    Posts
    145

    Default Re: Email special characters

    there is problem with some chars in html_escape
    Code:
    ?*html_escape("ššščáýžýáč**ĎŇČÉÓôäŽ")
    = "ššš&egrave;&aacute;&yacute;ž&yacute;&aacute;&egrave;&iacute;*&Iuml;&Ograve;&Egrave;&Eacute;&Oacute;&ocirc;&auml;Ž"
    š*žŽ is not converted ...

    and is there some function which can convert this:
    ššščáýžýáč**ĎŇČÉÓôäŽ
    to:
    &#x0161;&#x0161;&#x0161;&#x010D;&#x00E1;&#x00FD;&#x017E;&#x00FD;&#x00E1;&#x010D;&#x00ED;&#x0160;&#x010E;&#x0147;&#x010C;&#x00C9;&#x00D3;&#x00F4;&#x00E4;&#x017D;

    thanks

  7. #7
    Member
    Real Name
    pieter cremers
    Join Date
    Nov 2009
    Location
    Netherlands
    Posts
    146

    Default Re: Email special characters

    Alexander,

    Don't know if this is what you are looking for
    I solved my mail problem with this.
    You define the characters you want to translate = ss
    You define the characters you want them be be translated to = res
    You replace the characters in the string to get your result = strvar

    dim strvar as c
    dim ss as C
    dim res as C

    ss = "é" + crlf() + "á" + crlf() + "´" + crlf() + "€" + crlf() + "Ç" + crlf()
    ss = ss + "Ä" + crlf() + "È" + crlf() + "É" + crlf() + "Ë" + crlf() + "ç" + crlf()
    ss = ss + "Ï" + crlf() + "Ö" + crlf() + "Ü" + crlf() + "ß" + crlf()
    ss = ss + "*" + crlf() + "â" + crlf() + "ã" + crlf() + "ä" + crlf()
    ss = ss + "è" + crlf() + "ê" + crlf() + "ë" + crlf() + "ï" + crlf()
    ss = ss + "ö" + crlf() + "ü" + crlf() + "ø" + crlf() + "ú" + crlf()

    res = "&eacute;" + crlf() + "&aacute;" + crlf() + "&acute;" + crlf() + "&euro;" + crlf() + "&Ccedil;" + crlf()
    res = res + "&Auml;" + crlf() + "&Egrave;" + crlf() + "&Eacute;" + crlf()+ "&Euml;" + crlf() + "&ccedil;" + crlf()
    res = res + "&Iuml;" + crlf() + "&Ouml;" + crlf() + "&Uuml;" + crlf()+ "&szlig;" + crlf()
    res = res + "&agrave;" + crlf() + "&acirc;" + crlf() + "&atilde;" + crlf()+ "&auml;" + crlf()
    res = res + "&egrave;" + crlf() + "&ecirc;" + crlf() + "&euml;" + crlf()+ "&iuml;" + crlf()
    res = res + "&ouml;" + crlf() + "&uuml;" + crlf() + "&oslash;" + crlf()+ "&uacute;" + crlf()

    strvar = stritran_multi(strvar, ss, res)

    So maybe this works for you
    ss = "š" + crlf() + "č" + crlf()
    res = "&#x0161;" + crlf() + "&#x010D;" + crlf()

    hth

  8. #8
    Member tekri's Avatar
    Real Name
    Alexander Krišš
    Join Date
    Oct 2010
    Location
    Bratislava, Slovakia
    Posts
    145

    Default Re: Email special characters

    it's quit complicated, but thanks

Similar Threads

  1. handling special characters
    By mmaisterrena in forum Application Server Version 10 - Web/Browser Applications
    Replies: 1
    Last Post: 03-02-2010, 01:44 PM
  2. Special Text Characters
    By LeeG in forum Alpha Five Version 7
    Replies: 2
    Last Post: 01-17-2006, 12:13 PM
  3. special characters ü ä ï
    By Luc Verlee in forum Alpha Five Version 5
    Replies: 0
    Last Post: 01-21-2004, 12:17 PM
  4. special characters
    By martinwcole in forum Alpha Five Version 5
    Replies: 9
    Last Post: 10-04-2003, 07:26 AM
  5. Fractions - Special characters
    By kgilroy in forum Alpha Five Version 5
    Replies: 0
    Last Post: 11-19-2002, 12:29 AM

Bookmarks

Posting Permissions

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