I'm having trouble with an ascii character...
°
...getting turned into ...
°
...when I write it to a file and open in Excel. It looks fine in
notepad, but excel mucks it up. I can only guess it's a Ascii to UTF8
problem.
Does anyone have any idea, or perhaps a lesson on strings they'd like
to share?
Thanks,
Chad
> I'm having trouble with an ascii character...
>
[quoted text clipped - 10 lines]
> Does anyone have any idea, or perhaps a lesson on strings they'd like
> to share?
This is not an ASCII character (ASCII is only 7 bit). It is probably from an
8 bit extension of ASCII such as Windows-1252 or ISO-8859-1. Can you post
your code?
Cheers,

Signature
Joerg Jooss
joerg.jooss@gmx.net
Chad Chisholm - 17 Sep 2004 06:01 GMT
Yes. It's UTF8 encoding, I beleive. Here is my code:
class Class1
{
public static void Main(string[] args)
{
string degree = ("°");
string sFile = "testingAscii.csv";
System.IO.StreamWriter writer =
System.IO.File.CreateText(sFile);
try
{
writer.Write(degree);
}
finally
{
writer.Close();
}
System.Diagnostics.Process.Start(sFile);
}
}
Thanks for any advice.
Hans - 23 Sep 2004 14:49 GMT
try
System.IO.StreamWriter writer = new StreamWriter(sFile,
System.Text.Encoding.Default);
By using System.Text.Encoding.Default, the writer will use the system's
current ASNI code page.
Hans
> Yes. It's UTF8 encoding, I beleive. Here is my code:
>
[quoted text clipped - 20 lines]
>
> Thanks for any advice.