473,401 Members | 2,125 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,401 software developers and data experts.

read extended ascii values

hi,
i read the ascii value from a file and wrote the decimal one in other file.
But values above "127" i.e. extended ascii are printed as" 65533."
here ais wat i did:
Expand|Select|Wrap|Line Numbers
  1. private void button1_Click(object sender, EventArgs e)
  2.         {
  3.             int[] b = new int[100000];
  4.             StreamReader sw = new StreamReader("c: \\28D.09N");
  5.             for (int i = 0; i < 5000; i++)
  6.             {
  7.                 b[i] = sw.Read();
  8.                 //int c = sw.Read();
  9.                 //int a = (int)c;
  10.                 Console.WriteLine(b[i]);
  11.             }
  12.             /*SaveFileDialog sv = new SaveFileDialog();
  13.             sv.Filter = "text file|*.txt";
  14.             if (sv.ShowDialog() == DialogResult.OK)
  15.             {*/
  16.                 StreamWriter sr = new StreamWriter("c: \\bin28D.txt");
  17.                 for (int i = 0; i < 5000; i++)
  18.                 {
  19.                     sr.WriteLine(b[i]);
  20.                 }
  21.                 sw.Close();
  22.             }
any help for the extended ascii values plzzz
Dec 12 '09 #1
5 4612
tlhintoq
3,525 Expert 2GB
TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.

Sid: Let me be clear here. You have started over a dozen threads. You have been told this many times. If you can't be bothered to format your questions to make it easier on the volunteers trying to help you, then I wouldn't be surprised if the volunteers here just stopped reading your questions.
Dec 12 '09 #2
thanx for the tips
but i was expeting the solution
Dec 12 '09 #3
tlhintoq
3,525 Expert 2GB
thanx for the tips
but i was expeting the solution
Yeah, that is what I am coming to realize from all of your posts... You are expecting the solutions from someone else.
Dec 12 '09 #4
tlhintoq
3,525 Expert 2GB
Have you considered that you might have to read up on the functions you are using so you *understand* what they are doing?

For example: Reading the MSDN page for streamreader reveals
StreamReader defaults to UTF-8 encoding unless specified otherwise, instead of defaulting to the ANSI code page for the current system. UTF-8 handles Unicode characters correctly and provides consistent results on localized versions of the operating system.
Dec 12 '09 #5
tlhintoq
3,525 Expert 2GB
Do you know for FACT what the contents of the file are and how they were written? Or are you assuming it is ASCII?

HINT: Streamwriter also defaults to UTF-8, so if you wrote the file thinking it was ASCII then it is possible that streamwriter converted it to unicode.
Dec 12 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: | last post by:
Hey all, Quick question...been bugging me for some time, really. I have a console app, it does some things, and I want to save an array of text to a text file. The text consists of ASCII and...
13
by: bgbauer70 | last post by:
My appologies if this ends up being a duplicate post. For some reason the first post never showed up. I've tried about 300 iterrations of this same ability, and none of them seem to work in...
13
by: kristofvdw | last post by:
Hi, I have to treat a given text file, but haven't got a clue which extended ASCII set it is using. Opening the file in Windows' Notepad or in DOS, all accented letters and symbols are wrong....
4
by: wob | last post by:
Many thanks for those who responded to my question of "putting greek char into C string". In searching for an solution, I noticed that there are more than one version of "Extended ASCII...
1
by: Bülent Üstün | last post by:
Hi, im trying to upload somefiles using sockets to a FTP site. But i've some problems with extended ascii characters. When i try "MKD bülent" the created folder is "blent". The directory name is...
0
by: brrrdog | last post by:
Whenever I write to Response.Outputstream after doing a plain response.write, I get a delimiter between the two writes that is made up of three extended ascii chars (decimal equivalents 239,...
17
by: Gregor KovaÄ | last post by:
Hi! Does DB2 handle extended ASCII table? Example: VALUES(CHR(65)) =A VALUES(CHR(129)) =null, but according to www.asciitable.com should be u with umlaut. Any idea ?
1
by: s123 | last post by:
Hi, while invoking a web service, if in xml request message i wrap the extended ASCII characters with CDATA it is not returning the desired result, while this is not the case if i do not wrap...
13
by: ramif | last post by:
Is there a way to print extended ASCII in C?? I tried to code something, but it only displays strange symbols. here is my code: main() { char chr = 177; //stores the extended ASCII...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.