Unicode and ASCII codes

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hi,

Dim strTmp as String

strTmp contains not only standart set of characters (ASCII codes from 1-127)
but also some of them from the extended ASCII table (128-255).

I need to output this string to the file - WHERE EVERY CHARACTER REPRESEND
BY 1 BITE.
(I do not want to be "loud" but this is very important in my question)
If I do such:

Dim stwFile as StreamWriter
stwFile = File.CreateText("Filename.txt")
stwFile.WriteLine(strTmp)

At such case opens file for writing UTF-8 encoded text.
then I will get file where everycharacter from lower table represended by 1
bite and from the extended table 2 bites.

If I change settings and will use such:
strFile = New StreamWriter("Filename.txt", False,
System.Text.Encoding.ASCII)
This case looks like decide the problem - every character represented by 1
bite but the characters from Extended table - converted to the '?'

Maybe somebody has an idea how I can get 1 bite per character and they will
be shown at the output file the same as I have them in String variable.

Thanks

P.S. The "problem" characters - characters of the French alphabet.
 
Hi Mike,

There is a question in the newsgroup
microsoft.public.dotnet.general
from WEIWEIWEI and answered by Jon Skeet.

The question is different, however the answers could have been given to your
problem in my opinion.

It is not yet on Google I have seen, so you have to look for yourself.

I hope this helps,

Cor
 
Back
Top