Click here to Skip to main content
15,746,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I use a little piece of code in Visual C++. It works perfect.
I bring the same piece of code in C# and I get strange char.

It seams to be an encoding problem (the server is 1and1). When I try to save the string with the Win bloc note, he say the text is Unicode. So how can I go from Unicode to ASCII? Thanks a lot for your interest.
Nicolas.

Code extract :
hInternetSession = InternetOpen("VA", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); 
hInternetUrl = InternetOpenUrl(hInternetSession, (LPCSTR)txt, NULL, 0, 0 , 0); 
InternetReadFile(hInternetUrl, (LPVOID)szTemp,126, &dwRead);
HttpQueryInfo((HINTERNET)HTTP_QUERY_RAW_HEADERS,(DWORD)szTemp, &dwRead, 0, NULL);
InternetCloseHandle(hInternetUrl); 
InternetCloseHandle(hInternetSession);
Posted
Updated 16-May-10 12:46pm
v2

1 solution

Hello,

I answer my self.
It's OK. It was UTF-7 encoding.
I found it after i try all possibilities.
I'm sorry to disturb .
Good Evening to all
Nicolas
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900