Converting French Characters to ASCII on form submit
Hi there I was wondering if anyone can help with this. I am submitting values to an access database using ASP classic and need to convert French characters to ASCII. I have done it before with an form to email script. here is the code that I used with the first line being the code that writes a value to the database field. any help would be great.
[code]
'--------------------------------------------------------------------------
' Checks form fields and headings for French Characters and replaces them
' with the ASCII equivalent.
'--------------------------------------------------------------------------
rsAddComments.Fields(开发者_高级运维"Customer") = Request.Form("Customer")
body = Replace(body,"À",chr(192))
body = Replace(body,"Á",chr(193))
body = Replace(body,"Â",chr(194))
body = Replace(body,"Î",chr(206))
[/code]
Try to just put the ISO Latin 1 character set on the page:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
This work for me.
Actually that will not work. It is the way that access reads to text, same as outlook. I had to convert to ascii for outlook. What I did for that was
body = Replace(body,"é",chr(999))
Now I need to replace all of the values from the form fields with the ascii using ASP before it writes to the database. What I don't know is what to put in place of BODY in the above code.
精彩评论