So sick of answering this question, but I feel impelled to as you have made a common assumption that many make when it comes to encoding in ASP, PHP or whatever language you are using.
In web development encoding is intrinsically linked to
The source encoding you use to save the web page
Just looking at the comments under the iconv reference made me laugh and sad at the same time because there are so many people out there who don't understand this topic.
Take for example your PHP snippet
iconv("utf-8","ucs-2be","Мухтарам Мизоч");
This will work providing the following is true
- The page author saved the file using
UTF-8
encoding (Most modern editors have this option in some shape or form).
The client Internet Browser knows it should be handling the page as UTF-8
either via a meta tag in the HTML,
<meta http-equiv="content-type" content="text/html; charset=utf-8">
or by specifying a HTTP Content-Type Header
In terms of Classic ASP it is the same you need to;
Make sure the page is saved as UTF-8
encoding, this includes any #include
files that are dependencies.
Tell IIS that your pages are UTF-8
by specifying this pre-processing instruction at the very top of the page (must be the first line).
<%@Language="VBScript" CodePage = 65001 %>
Tell the browser what encoding you are using
<%
'Tell server to send all strings back to the client as UTF-8
'while also setting the charset in the HTTP Content Type header.
Responce.CodePage = 65001
Response.ContentType = "html/text"
Response.Charset = "UTF-8"
%>
UPDATE:
Neither UCS-2
(UTF-16
LE) or UCS-2BE
(UTF-16
BE) are supported by Classic ASP, specifying either CodePage
(1200 or 1201) will result in;
ASP 0203 - Invalid CodePage Value
After reading a bit about Kannel it does appear as though you can control the character set you send to the SMS gateway, I would recommend you try to send it using UTF-8
.
Links
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…