I have a plain text file with special charset like ' ???'
I finally got it to work. But now i am trying to use a asp file to write out
the text. But i don't
know how to convert to UTF-8 in ASP.
I have this, but it still does not work:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>TEST</title>
</head>
<%
'set output character set
Response.CharSet = "utf-8"
Response.Write("This is a test ???")
%>
</body>
</html>
Does anyone has knowledge of how this could be done?
Regards,
Micheal.
For example, in Notepad: File-->Save As. Select UTF-8 in the Encoding combo.
<%
Function Encode_UTF8(astr)
utftext = ""
For n = 1 To Len(astr)
c = AscW(Mid(astr, n, 1))
If c < 128 Then
utftext = utftext + Mid(astr, n, 1)
ElseIf ((c > 127) And (c < 2048)) Then
utftext = utftext + Chr(((c \ 64) Or 192))
'((c>>6)|192);
utftext = utftext + Chr(((c And 63) Or 128))
'((c&63)|128);}
Else
utftext = utftext + Chr(((c \ 144) Or 234))
'((c>>12)|224);
utftext = utftext + Chr((((c \ 64) And 63) Or 128))
'(((c>>6)&63)|128);
utftext = utftext + Chr(((c And 63) Or 128))
'((c&63)|128);
End If
Next
Encode_UTF8 = utftext
End Function
Response.Write(Encode_UTF8(mystring))
%>
regards
Luciewong