473,320 Members | 1,948 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,320 software developers and data experts.

problem with the encodüng of the posted data

Hi,

I am posting some data in Turkish with the HttpWebRequest and saving the
response stream in the database. The characters in the page are shown
properly but the Turkish characters in the posted data are not shown
properly. I couldn't find any solution. Please help me...
Code is given below:

Sub UploadDoc()
Dim myWebReq As HttpWebRequest
Dim myWebResp As HttpWebResponse
Dim authCookie As HttpCookie
Dim cc As New CookieContainer()
Dim encoding As New System.Text.UnicodeEncoding()
Dim postData As String
Dim data() As Byte
Dim s As Stream
Dim sr As StreamReader
myWebReq =
WebRequest.Create("http://burak/database/medicalDocs/F324.aspx")
authCookie = Request.Cookies(FormsAuthentication.FormsCookieNam e)
myWebReq.CookieContainer = cc
myWebReq.CookieContainer.Add(New System.Net.Cookie(authCookie.Name,
authCookie.Value, authCookie.Path, "burak"))
postData += "fd=" + txtFlightDate.Text
postData += "&"
postData += "fn=" + txtFlightNo.Text
postData += "&"
postData += "notes=" + txtNotes.Text
data = encoding.GetBytes(postData)
myWebReq.Method = "POST"
myWebReq.ContentType = "application/x-www-form-urlencoded"
myWebReq.ContentLength = data.Length
s = myWebReq.GetRequestStream()
s.Write(data, 0, data.Length)
myWebResp = myWebReq.GetResponse
s.Close()
sr = New StreamReader(myWebResp.GetResponseStream, encoding.Unicode)
Dim strHTML As String
strHTML = sr.ReadToEnd()
Dim docBuffer() As Byte
docBuffer = encoding.GetBytes(strHTML)
'Upload into the database..

strSql = "spUploadDocIntoDatabase"

Nov 20 '05 #1
1 1412
I have same problem with cyrilic characters (I got spaces). After I deleted
codePage="1251" from aspx file all work correct.

"buran" <bu***@buran.com> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:OY**************@TK2MSFTNGP09.phx.gbl...
Hi,

I am posting some data in Turkish with the HttpWebRequest and saving the
response stream in the database. The characters in the page are shown
properly but the Turkish characters in the posted data are not shown
properly. I couldn't find any solution. Please help me...
Code is given below:

Sub UploadDoc()
Dim myWebReq As HttpWebRequest
Dim myWebResp As HttpWebResponse
Dim authCookie As HttpCookie
Dim cc As New CookieContainer()
Dim encoding As New System.Text.UnicodeEncoding()
Dim postData As String
Dim data() As Byte
Dim s As Stream
Dim sr As StreamReader
myWebReq =
WebRequest.Create("http://burak/database/medicalDocs/F324.aspx")
authCookie = Request.Cookies(FormsAuthentication.FormsCookieNam e)
myWebReq.CookieContainer = cc
myWebReq.CookieContainer.Add(New System.Net.Cookie(authCookie.Name, authCookie.Value, authCookie.Path, "burak"))
postData += "fd=" + txtFlightDate.Text
postData += "&"
postData += "fn=" + txtFlightNo.Text
postData += "&"
postData += "notes=" + txtNotes.Text
data = encoding.GetBytes(postData)
myWebReq.Method = "POST"
myWebReq.ContentType = "application/x-www-form-urlencoded"
myWebReq.ContentLength = data.Length
s = myWebReq.GetRequestStream()
s.Write(data, 0, data.Length)
myWebResp = myWebReq.GetResponse
s.Close()
sr = New StreamReader(myWebResp.GetResponseStream, encoding.Unicode) Dim strHTML As String
strHTML = sr.ReadToEnd()
Dim docBuffer() As Byte
docBuffer = encoding.GetBytes(strHTML)
'Upload into the database..

strSql = "spUploadDocIntoDatabase"

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Aaron Prohaska | last post by:
I have just run into a problem where I have a page that posts back to itself to execute code, except when the page does the post back it somehow executes code that is in our home page for the site....
2
by: Sojwal | last post by:
We are working on a asp.net application in which we need to send some data to a PHP application on another server. We are using HttpWebRequest object to 'POST' the data to a PHP page as key-value...
11
by: Abhishek | last post by:
I have a problem transfering files using sockets from pocket pc(.net compact c#) to desktop(not using .net just mfc and sockets 2 API). The socket communication is not a issue and I am able to...
1
by: buran | last post by:
Hi, I am posting some data in Turkish with the HttpWebRequest and saving the response stream in the database. The characters in the page are shown properly but the Turkish characters in the...
0
by: Lotta P | last post by:
Hi, I have a problem concerning encoding when posting a form. The form (a textbox and a button) is posted using JavaScript and a window.location("http://therecieverofthedata"). The website...
0
by: egbert.beuker | last post by:
Hi, I encountered a conversion problem in my .net web app (c#), and I hope someone can help me: I'm working on a generic way to store data in a database with a few generated classes. I want...
0
by: JACompute | last post by:
I have an invoicing system that uses a VB6 program to post new invoice entries to a centralized Vendor management system (also in VB6), via a Web server and some ASP code. The system has been in...
9
by: HC | last post by:
Hello, all, I started out thinking my problems were elsewhere but as I have worked through this I have isolated my problem, currently, as a difference between MSDE and SQL Express 2005 (I'll just...
4
by: daroman | last post by:
Hi Guys, i've problem with my small C++ programm. I've just small template class which represetns a array, everything works fine up to combination with std::string. I did tried it with M$ VC++ and...
1
by: Dhananjay | last post by:
hi all, I am facing problem in programming.Can anybody please let me know how to solve the problem. I have a link, clicking the link opens a page in which there are some data which is coming from...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.