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

Test file input output trouble!


I use StreamReader and StreamWriter to manipulate a text file file .
The problem is that my Norgian characters get altered.

How can i preserve the character set to ASCI ?

Thanks
JJ
Oct 18 '06 #1
2 1492
Hi Jens,

The default encoding for StreamReader/StreamWriter is UTF8. I'm guessing
the file isn't UTF8-encoded, so you need to use the overloaded constructor
and specify the proper encoding before you read/write. Try
Encoding.Default.
On Wed, 18 Oct 2006 11:12:28 +0200, Jens Jensen <jj@jensen.dkwrote:
>
I use StreamReader and StreamWriter to manipulate a text file file .
The problem is that my Norgian characters get altered.

How can i preserve the character set to ASCI ?

Thanks
JJ



--
Happy Coding!
Morten Wennevik [C# MVP]
Oct 18 '06 #2
Well My question was badly formulated,but you gave the correct response.

Many thanks
JJ
Oct 18 '06 #3

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

Similar topics

1
by: moonriver | last post by:
In a xml file, can we make reference to another xml file so that all contents of the latter xml file will be included into the first xml file? Had better give me an example for details.
5
by: Sakcee | last post by:
Hi I am trying to use pyUnit to create a framework for testing functions I am reading function name, expected output, from a text file. and in python generating dynamic test functions...
27
by: Josh | last post by:
We have a program written in VB6 (over 100,000 lines of code and 230 UI screens) that we want to get out of VB and into a better language. The program is over 10 years old and has already been...
2
by: oscar78 | last post by:
Hi, I am trying to write a perl script that will read a three-column data file and write certain lines of it in to a new data file according the ranges of values that each of these lines contain. ...
8
by: killkolor | last post by:
hi! I have a unittest framework that tests a single function that in turn works with files (takes input and outputs in the same file, no return values). In the unittest class I assign a member...
8
by: sore eyes | last post by:
Hi I just downloaded the free Watcom compiler and am having a little trouble with File IO http://www.openwatcom.org/index.php/Download I downloaded the following example, commented out the...
1
by: rich_sposato | last post by:
I released version 2.0 of C++ Unit Test Library. You can download it from SourceForget.Net at http://sourceforge.net/projects/cppunittest/ .. I wrote this unit test library because other unit...
12
by: Fozzi | last post by:
Hey all I have been working on a project which allows me to write to a file and retrieve from that file, but i having trouble with it These are my inputs: private int flightno; ...
1
by: r3d dra6on | last post by:
I am trying to get the file size of a memory mapped I/O from the input file, and set that size to the output file. Right now the code below is stuck on the kernel mapping for the output. The...
5
by: parthaspanda22 | last post by:
How can I get to discard the contents of a text file from a specified offset( say, obtained from ftell)? Sincerely.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.