D
Dan V.
How do I create a one line text file with these control codes? e.g.: 144 =
0x90 and 147 = 0x93?
I am trying to create a one line text file with these characters all one one
row with no spaces.
1. 144 = 0x90
2. 147 = 0x93
3. STX = (^B = 2 = 0x2)
4. NUL = (^@ = 0 = 0x0)
5. DC4 = (^T = 20 = 0x14)
6. SOH = (^A = 1 = 0x1)
7. GS (^] = 29 = 0x1d)
8. RS = (^^ = 30 = 0x1e
I tried StreamWriter, BinaryWriter... but it can't seem to handle the 147 =
0x93 without putting a strange 'A' character.
This is for use with a legacy program and that 'A' character can not be in
the text file.
I am using TextPad 4 to view the control characters.
The code below is close, but for 144 and 147 the strange 'A' character
exists prior to the Control code.
// BUG?: Do not specify encoding 'System.Text.Encoding.UTF8' else 147 will
not work: (even though documentation says UTF8 is default).
StreamWriter sw = new StreamWriter(@"C:\Text2.txt", false);
sw.WriteLine("Encoding: {0}", sw.Encoding.ToString());
sw.Write( (char) 144 );
sw.Write( (char) 147 );
sw.Write( (char) 2 );
sw.Write( (char) 0 );
sw.Write( (char) 20 );
sw.Write( (char) 1 );
sw.Write( (char) 29 );
sw.Write( (char) 30 );
sw.Close();
0x90 and 147 = 0x93?
I am trying to create a one line text file with these characters all one one
row with no spaces.
1. 144 = 0x90
2. 147 = 0x93
3. STX = (^B = 2 = 0x2)
4. NUL = (^@ = 0 = 0x0)
5. DC4 = (^T = 20 = 0x14)
6. SOH = (^A = 1 = 0x1)
7. GS (^] = 29 = 0x1d)
8. RS = (^^ = 30 = 0x1e
I tried StreamWriter, BinaryWriter... but it can't seem to handle the 147 =
0x93 without putting a strange 'A' character.
This is for use with a legacy program and that 'A' character can not be in
the text file.
I am using TextPad 4 to view the control characters.
The code below is close, but for 144 and 147 the strange 'A' character
exists prior to the Control code.
// BUG?: Do not specify encoding 'System.Text.Encoding.UTF8' else 147 will
not work: (even though documentation says UTF8 is default).
StreamWriter sw = new StreamWriter(@"C:\Text2.txt", false);
sw.WriteLine("Encoding: {0}", sw.Encoding.ToString());
sw.Write( (char) 144 );
sw.Write( (char) 147 );
sw.Write( (char) 2 );
sw.Write( (char) 0 );
sw.Write( (char) 20 );
sw.Write( (char) 1 );
sw.Write( (char) 29 );
sw.Write( (char) 30 );
sw.Close();