4

私のサイトは現在 UTF-8 のみで動作していますが、serverXMLHTTP を使用して SMS を送信するには、メッセージを送信する前に UTF-8 から ISO-8859-1 に変換する必要があります。

状況はこれと並行しています。

a.asp:

<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body>
<form method="post" action="b.asp">
<input type text name="message" value="æøå and ÆØÅ"><br>
<input type=submit>
</body>

そしてb.asp

<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head><body>
<%=konvert(request("message"))%><br>
</body>
<%
Function Konvert(sIn)
    Dim oIn : Set oIn = CreateObject("ADODB.Stream")
    oIn.Open
    oIn.CharSet = "UTF-8" 
    oIn.WriteText sIn
    oIn.Position = 0
    oIn.CharSet = "ISO-8859-1"
    Konvert = oIn.ReadText
    oIn.Close
End Function
%>

このショーケースでは、a.asp に送信したのと同じ文字列が b.asp に表示されると予想されますが、次のようになります。

æøå and ÆØÅ

何か案は?

4

1 に答える 1