howto transfer chr(1) to a server via webservice

P

ProJee

1.

How to pass chr(1) (or another special char below 32) to a method in a
webservice?
It raises an exception when I try to pass it through webservice.htc

2.
How to pass chr(255)
It doesn't raise an exception, but another character comes to the server
in some cases (different server= different results).. probably some
regional settings.


thanks a lot.
 
R

Rick Strahl [MVP]

How are you passing the data? These characters would be considered binary in
this case? In that case you'd have to use byte[] as the type to send the
data.

If you are sending string data you have to remember about string encodings.
It's possible that a client is running a specific encoding that is different
than the encoding on the server resulting in a possible mismatch.

You can explicitly convert to a specific encoding on the server side but
this may still cause problems if the client sent data that is locale
specific and you're not retrieving the data in the same locale. If both ends
are using pure Unicode encoding then there should be no problem.

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
http://www.west-wind.com/wwThreads/
 
E

Eliahu

Just an idea ..

Have a look at Server.HtmlEncode / HtmlDecode methods. Maybe it will work.
 
P

ProJee

thanks for the reply,

another question:

how can I convert a string in a variable (vbscript in IE6) to unicode
before it's sent to the server by webservice.htc?


ProJee
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top