I looked into the UTF-8 characters in question, and am now very suspicious of the characters themselves, as they are only supported by a handful of fonts.
Furthermore, after editing my test file in Notepad, to replace the offending characters in an environment in which I was sure the resultant character would be encoded as ASCII, voila!, no more problems when uploading the file.
I think the problem is therefore with...
User Profile
Collapse
-
I'm sorry. I forgot to mention that I've tried several different solutions involving the System.Text.Enc oding class. I have tried using the UTF8 property to decode my byte array. The result is the same as using the Convert.ToChar method. I have also tried creating a UTF8 Decoder, and using its GetChars method; that led me to trying to detect when the byte value was over 127 ( outside of ASCII range ) and create a UTF32 character, using three other...Leave a comment:
-
UTF-8 Character Decoding Problem
I am using a HtmlInputFile control in ASP.NET 2.0 to upload a file in a UserControl. After upload, I am examining the HttpPostedFile property of this object to read the bytes of the uploaded file's input stream, convert them to characters, and store them in a database.
For the most part, the process I had in place was working, but I noticed certain characters in my test file were not decoded correctly. I investigated the values of...
No activity results to display
Show More
Leave a comment: