asp utf8 mysql cdosys

Author Message
dan78

  • Total Posts : 1
  • Scores: 0
  • Reward points : 0
  • Joined: 6/15/2009
  • Status: offline
asp utf8 mysql cdosys Monday, June 15, 2009 10:51 PM (permalink)
0
Hi,
my problem is the character encoding of Cyrillic, I put the correct data in the db correctly or sending the mail, I can not satisfy both requirements.
The db tables and columns all set to utf8 and the following page pag1.asp enter the correct data in the db, the mail is incorrect calls (not coded correctly type ¾ Ð ¿Ð ¾ Ð »Ð ½ Ð ¸ Ñ") . Adding on top of the page <% @ CodePage = "65001"%> "is sent correctly mail, db is included in all ??????
   
Thanks in advance
 
  
  <%  
 Set conn = Server.CreateObject("ADODB.Connection")  
 conn.Open "Driver={MySQL ODBC 3.51 Driver};Server=ip;charset=UTF8;Database=db;User=user; Password=pas;Option=3;"  
   
 step = request("step")  
 if step = 1 then  
  nomeS = request("nomeS")  
  viaS = request("viaS")  
    
  sqlInsert="insert into archivioFaq (nomeS, viaS)values('"&nomeS&"','"&viaS&"')"  
  conn.execute("SET NAMES utf8")  
  conn.execute(sqlInsert)  
    
    
  messMail = nomeS&" "&viaS&"<br>"  
    
  Set Config = Server.CreateObject("CDO.Configuration")  
  Set Fields = Config.Fields  
  Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")=2  
  Fields.Item("[link=http://schemas.microsoft.com/cdo/configuration/smtpauthenticate]http://schemas.microsoft.com/cdo/configuration/smtpauthenticate[/link]") = 1  
  Fields.Item("[link=http://schemas.microsoft.com/cdo/configuration/smtpserver]http://schemas.microsoft.com/cdo/configuration/smtpserver[/link]") = "localhost"  
  Fields.Update  
  Set MiaMail = Server.CreateObject("CDO.Message")  
  Set MiaMail.Configuration = Config  
  MiaMail.To = "miamail"  
  MiaMail.From = "miamail"  
  MiaMail.Bodypart.Charset = "UTF-8"  
  MiaMail.Subject = "oggetto"  
  MiaMail.HTMLBody = messMail  
    
    
  MiaMail.Send()  
  set MiaMail = Nothing  
  Set Fields = Nothing  
  Set Config = Nothing  
 end if  
 %>  
   
 <html>  
 <head>  
 <title>Amministrazione</title>  
 <META http-equiv="Content-Type" content="text/html; charset=UTF-8">  
 <style type="text/css">  
 <!--  
 body {  
  background-color: #D4ECD4;  
 }  
 -->  
 </style>  
 <link href="../style.css" rel="stylesheet" type="text/css">  
 </head>  
 <body >  
   
 <form name="regDo" action="pag1.asp" method="post" >  
 <input type="hidden" name="step" value="1">   
   <tr>  
  <td colspan="3" class="textbold2">&nbsp;</td>  
      </tr><tr><td colspan="3" class="textbold3">&nbsp;</td>  
      </tr>  
      <tr>  
     <td bgcolor="#CCCCCC"  class="textbold"><strong>Nome struttura<br>  
           <label>  
        <input name="nomeS" type="text" class="textbold" id="nomeS" size="40">  
            </label>  
     </strong></td>  
     <td bgcolor="#CCCCCC"  class="textbold" ><strong>Indirizzo<br>  
           <input name="viaS" type="text" class="textbold" id="viaS" size="50">  
     </strong></td>  
         <td bgcolor="#CCCCCC"  class="textbold"><label>  
       <input name="Submit2" type="submit" class="riepilogoTotali" value="REGISTRA FAQ">  
     </label></td>  
   
      </tr>  
      <tr>  
        <td colspan="4" class="testo"><hr noshade class="titVerde"></td>  
      </tr>  
    </form>  
 </body>  
 </html>  
 <%  
 conn.Close  
 Set conn=Nothing  
 %>  
   
 
 
#1
    TNO

    • Total Posts : 2094
    • Scores: 36
    • Reward points : 0
    • Joined: 12/18/2004
    • Location: Earth
    • Status: offline
    RE: asp utf8 mysql cdosys Friday, June 19, 2009 1:46 AM (permalink)
    0
    Since you're sending an html email, I guess you could try using entity codes. Of course you would have to write your own conversion routine which shouldn't be too hard since its based on the character code

    http://tlt.its.psu.edu/suggestions/international/bylanguage/cyrillicchart.html
    To iterate is human, to recurse divine. -- L. Peter Deutsch
     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9