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

Missing chars after reading line

Hi,

I'm just developing a .net (compact) application and therefore make use of
the StreamReader class - and especially the ReadLine function. Now, when I
try to read lines from a text file that includes 'german' strings with
specific chars (like ä,ü,ö, etc.) they do not appear in the returned string.
What's wrong here?

By the way, if it is of any importance, I currently use an english version
of VS.net 2003 - that's why there's also an english .net framework installed
on the pocket pc I'm testing on.

Greetings,
Andreas
Jul 21 '05 #1
2 1186
Sounds like it might be an encoding issue. I would say (a) make sure that
you're using the latest service pack (SP3 [1]), and (b) try explicitly
specifying an encoding when creating the StreamReader instance. There are
some conversations in the google archives about this, here is one.
http://www.google.ca/groups?hl=en&lr...254040tude.net

[1]
http://www.microsoft.com/downloads/d...DisplayLang=en

--
Tim Wilson
..Net Compact Framework MVP

"Andreas" <An*****@discussions.microsoft.com> wrote in message
news:8B**********************************@microsof t.com...
Hi,

I'm just developing a .net (compact) application and therefore make use of
the StreamReader class - and especially the ReadLine function. Now, when I
try to read lines from a text file that includes 'german' strings with
specific chars (like ä,ü,ö, etc.) they do not appear in the returned string. What's wrong here?

By the way, if it is of any importance, I currently use an english version
of VS.net 2003 - that's why there's also an english .net framework installed on the pocket pc I'm testing on.

Greetings,
Andreas

Jul 21 '05 #2
Andreas <An*****@discussions.microsoft.com> wrote:
I'm just developing a .net (compact) application and therefore make use of
the StreamReader class - and especially the ReadLine function. Now, when I
try to read lines from a text file that includes 'german' strings with
specific chars (like ?,?,?, etc.) they do not appear in the returned string.
What's wrong here?

By the way, if it is of any importance, I currently use an english version
of VS.net 2003 - that's why there's also an english .net framework installed
on the pocket pc I'm testing on.


Chances are you're using the wrong encoding.

See http://www.pobox.com/~skeet/csharp/unicode.html

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #3

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

Similar topics

8
by: Nick | last post by:
Hi ! I want to load an old Pascal-Dos-File where records stand in. When i view the file in a HEX-Editor it's clear how to acces these Strings and chars in that file. Since these are old 8BIT...
2
by: Andreas | last post by:
Hi, I'm just developing a .net (compact) application and therefore make use of the StreamReader class - and especially the ReadLine function. Now, when I try to read lines from a text file that...
16
by: lovecreatesbeauty | last post by:
/* When should we worry about the unwanted chars in input stream? Can we predicate this kind of behavior and prevent it before debugging and testing? What's the guideline for dealing with it? ...
8
by: bart.kowalski | last post by:
I'm trying to read a text file that contains international (specifically Polish) characters line by line. I'm using the following C# code: FileStream lStream = new FileStream(pFileName,...
8
by: Elijah Cardon | last post by:
1 1 1 1 1 1 2 2 2 1 1 1 3 3 3 1 1 1 4 4 1 2 1 1 5 5 2 2 1 1 6 6 3 2 1 1 7...
0
by: Dustin J. Mitchell | last post by:
I'm building an interface to Amazon's S3, using httplib. It uses a single object for multiple transactions. What's happening is this: HTTP PUT /unitest-temp-1161039691 HTTP/1.1 HTTP Date: Mon,...
5
by: MLH | last post by:
I'm using A97 import data wizard to import text file N2 a table. The text file is a DIR listing produced by running dir jdc*.* /s c:\JDCs.txt The wizard is chopping the lines off at the...
9
by: Matthew | last post by:
I'm using PHP version 4.4.3. The manual page for PHP's mail() function (URL below) says that for the message (IE. email body) "Each line should be separated with a LF (\n). Lines should not be...
13
by: Hongyu | last post by:
Hi, I have a datetime char string returned from ctime_r, and it is in the format like ""Wed Jun 30 21:49:08 1993\n\0", which has 26 chars including the last terminate char '\0', and i would...
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.