473,383 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

How to Send a UniCode String in XMLHTTP Query String?

nicebasic
Hello everybody,

I'm trying to use an SMS Panel to send my messages online. The format for using their URL Service is like this:
Expand|Select|Wrap|Line Numbers
  1. http://YourSite.com/post/sendSMS.ashx?from="FromNumber"&to="ToNumber"&text="Message"&password="MyPassword"&username="MyUserName"
For example, if you wish to send "Hello friends" from "04155157981" to "1000457871" and your Username is "Richard" and your password is "Good_not", you should use the above command like this:
Expand|Select|Wrap|Line Numbers
  1. http://YourSite.com/post/sendSMS.ashx?from=04155157981&to=1000457871&text="Good_not"&password="Good_not"&username=Richard
I can use this command to send SMS online. If the SMS is sent successfully, the resulted page will show you a code. Code 1 shows that the SMS has been delivered successfully. If you view the HTML source code of the resulted page, you can only see a digit. In my case, since nearly all messages are successfully delivered, I see number 1 as the result.

I have no problem in sending messages that are in English, but this does not work for other languages. If you type the UniCode message in the address bar, it runs successfully, but from within an ASP Classic Page, it sends corrupted message which is not readable.

I tried to use the following code for ASP Classic, but it failed:
Expand|Select|Wrap|Line Numbers
  1. smsFrom = "04155157981"
  2. smsTo = "1000457871"
  3. smsText = "یک متن آزمایشی به زبان فارسی"
  4. smsPass = "Good_not"
  5. smsUser = "Richard"
  6.  
  7. url = "http://YourSite.com/post/sendSMS.ashx?from=<%=smsFrom%>&to=<%=smsTo%>&text=<%=smsText%>&password=<%=smsPass%>&username=<%=smsUser%>"
  8.  
  9.     set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
  10.     xmlhttp.open "GET", url, false
  11.     xmlhttp.send ""
  12.     Response.write xmlhttp.responseText
  13.     set xmlhttp = nothing
I searched the net for this problem. Some have suggested adding these lines to the beginning of your ASP page:
Expand|Select|Wrap|Line Numbers
  1. <%@ codepage=65001 Language=vbScript %>
  2. <% Response.CharSet = "utf-8" %>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
I did so, but it didn't help. I'm really confused.

Does anyone know how to solve this problem?

Any suggestion will be appreciated.
Jul 17 '12 #1
0 1809

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Phil Powell | last post by:
I created a page that will be doing image resizing and manipulation, which seems to work (using GD library). However, upon returning to the page where the image has been changed, I still see the...
9
by: Mark | last post by:
I've run a few simple tests looking at how query string encoding/decoding gets handled in asp.net, and it seems like the situation is even messier than it was in asp... Can't say I think much of the...
2
by: bhavik | last post by:
hi i want to know how to hide the values in query string in ASP.net. here i want to send the values from one page to another page through query string with out explicitly visible the values in...
2
by: aparnasinha26 | last post by:
Hi All, I have to pass variable in a query string. The query string is in the hyperlink coloumn of a datgrid. The code appears like this <asp:HyperLinkColumn DataNavigateUrlField="ProductID"...
18
by: A.M | last post by:
Hi, Is there any way to call a WSS web service method by using browser and see the XML result in browser as well? I have been told that there is query string syntax for calling...
1
by: Lu Wei | last post by:
Hello, I'm writing a script to send posts to a web forum. I find that MSXML2.XMLHTTP object could communicate with web server but I can't make it send cookie which is needed for post...
3
by: craigkenisston | last post by:
I need to send a big amount of data to one server in the query string. It is like 3kb of text information, in ascii code with linefeeds and carriage returns. I noticed that using winzip I can get...
5
by: Holger Joukl | last post by:
Hi there, I consider the behaviour of unicode() inconvenient wrt to conversion of non-string arguments. While you can do: u'17.3' you cannot do:
24
by: MU | last post by:
Hello I have some code that sets a dropdownlist control with a parameter from the querystring. However, when the querystring is empty, I get an error. Here is my code: Protected Sub...
4
Claus Mygind
by: Claus Mygind | last post by:
In my code I am sending a number of records via an ajax post method to the web-server for updating a table. I will parse the query string when it is received on the server side. But I am not sure...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.