Groups | Blog | Home
all groups > dotnet compact framework > september 2005 >

dotnet compact framework : ProtocolViolationException with Pound Sign.


Lawrence Anstey
9/14/2005 4:09:03 AM
We have a VB.NET Compact Framework application that POSTs data to a HTTP
server. Much of this data is entered by the user, and encapsulated in a XML
document.

However, if the user enters any character from the foreign character
keyboard, the HTTPWebRequest throws a ProtocolViolationException, with no
message.

This is a problem, as we are based in the UK, so our users will frequently
use the pound sign (£), which causes this error.

I have tried changing the Content-Type, Media-Type and Accept headers, but I
am not sure what they should be changed to, or even if that would solve my
problem.

Lawrence Anstey
9/14/2005 6:03:04 AM
I have since fixed it, I needed to create the StreamWriter with ASCII encoding:
WebWrite = New StreamWriter(WebStream, System.Text.Encoding.ASCII)

[quoted text, click to view]
AddThis Social Bookmark Button