|
-
Re: unable to read special character ( ° ) using streamreader
You need to specify the encoding when you open the StreamReader, e.g.
Dim reader As New StreamReader(fs, System.Text.Encoding.UTF7)
"robbie" <choonwei81@hotmail.com> wrote in message
news:3e5d7862$1@tnews.web.devx.com...
>
> wonder if anyone knows the solution to my problem. currently, im using a
streamreader
> to read from a text file. some part of the codings are as below :
> Dim filelocation As String = "d:\inetpub\wwwroot\batchtest.txt"
> Dim fs As New FileStream(filelocation, FileMode.Open, FileAccess.Read)
> Dim objreader As New StreamReader(fs)
> While objreader.Peek() > -1
> chr = Strings.Chr(objreader.Read)
> response.write(chr)
> end while
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> If the content of text file is: "Temperature","T","°C",
> the output i get is only : "Temperature","T","C", (where the degree
character
> (°) is omitted and not read by the streamreader at all.Please help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks