Http requests and character transfer

K

kikapu

Hi to all,

we are building a fairly complex system here in work, and we couldn't
imagine
from the start that we would spend too much time just to transfer safely
some kind of characters from one network point to another...


I explain:

One part of our system is a custom, multithreaded http server that sits
and waits
for requests to be dispatched.
One of the arguments of these requests may have Greek characters within
it.
(requests is something like this: /ContactService;787;NetworkID;sid;and
here goes the Greeks)

We used C# 2 to create the http server, while the client that sends the
requests maybe a .net component of ours,
or calls from Sql Server 2000 through the WinHttp COM dll that Microsoft
provides
(using WinHttp 5.1 on Windows Server 2003) by a stored procedure that we
also have written
(sp_oacreate and the like)

we have found a mapping that works in one case and Greek characters are
transfered correctly
but not in another (e.x. mapping that works with our custom http server
but not when sending
in a browser where the Greeks are not displayed at all...)

In any case, is there a "correct" way, or a standard, to be used in
situations that envolve
http requests and characters transfering other that standard English ??
And i am not talk only about custom http servers but also web browsers,
web servers etc etc...




thanks a lot for any help on this,


Kikapu
 
M

Morten Wennevik

Hi Kipaku,

Take a look at Server.UrlEncode/UrlDecode (characters in the url) or
Server.HtmlEncode/HtmlDecode (characters in the document itself)
 
K

kikapu

Hi Kipaku,

Take a look at Server.UrlEncode/UrlDecode (characters in the url) or
Server.HtmlEncode/HtmlDecode (characters in the document itself)


Ok thanks, i will have a look for this.
But in the first scenario, i have to deal with WinHttp and COM,
and i cannot find a standard way to do these conversions...

Kikapu
 
L

Luke Zhang [MSFT]

Then, you may take a look at the classs "HttpUtility" and its methods, it
also can convert a string from web request.

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
K

kikapu

Ok Luke, but isn't this a .net specific class ??
The problem currently i have is that i try to find a generic way to do
these conversions event in the scenario that a com (WinHttp) client
calls a .net Http Server...


Thanks again.

(e-mail address removed) (Luke Zhang [MSFT]) wrote in
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

kikapu said:
Ok Luke, but isn't this a .net specific class ??
The problem currently i have is that i try to find a generic way to do
these conversions event in the scenario that a com (WinHttp) client
calls a .net Http Server...

URL encoding is a well documented standard.

You can do it in .NET, Java, VB6 whatever.

Even if you have to code it yourself the algorithm is
very simple.

Arne
 
L

Luke Zhang [MSFT]

I may be a little confused here. My suuggestion is to use HttpUtility" and
its methods in the .NET Server side code, to convert string passed from
client side. Is your server side should be a .NET application, or I
misunderstood something?

If there is any further question or concern, please feel free to let me
know.

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
K

kikapu

Yes, the server side is .net app but it may well receive requests
from various clients, including COM as i previously said.

Do you mean that by using the HttpUtility class and methods on the
server, it doesn't then matter from which client (.net/com or other) the
server gets it's data ??



(e-mail address removed) (Luke Zhang [MSFT]) wrote in
 
L

Luke Zhang [MSFT]

The answer is Yes if it was an HTTP Request. BTW, to trouble shoot such a
problem, you may also use some network trace tool like NETMON, or Fiddler,
to see what is actual data translated between server and client.

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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

Top