Strange β€œΓ‚β€ symbol before degrees Celcius symbol β€œΒ° C”

I asked this question a day ago regarding the Greek characters of Unicode, and now I have a question that is based on this.

After extracting all my data, I tried to prepare it for import into Excel. I had to select a tab delimited file because some of my data contains commas (I got lucky!).

The problem I am facing is a very strange character after importing data into Excel.

The column data in Notepad ++ looks like this:

Total Suspended Solids @105Β°C 

Excel cell data is as follows:

 Total Suspended Solids @105°C 

I do not understand why this is happening. Is this related to the way the degree symbol is represented?

ps i are characters in this question - direct copy and paste

+4
source share
3 answers
  • (Most likely) Excel interprets your text data as latin-1 or windows-1252, not UTF-8. "ΒΊ" is what you get if you take UTF-8 bytes for "Β°" ( 0xc2 0xb0 ) and interpret each byte as a Latin-1 or window-1252 character. Is there an option to enter the encoding during import?
  • (Less likely) Excel does everything right, but you encode your data twice (encoding as UTF-8, and then re-interpret it as 8-bit encoding and encoding as UTF-8 or any other Unicode encoding). Notepad ++ is evidence against this.
+6
source

I'm not quite sure, but I think Excel expects a character encoding of Windows-1252, so create your text file using Encoding.GetEncoding("Windows-1252") .

For instance:

 using (var writer = new StreamWriter(fileName,false,Encoding.GetEncoding("Windows-1252")) { .... } 
+3
source

You can use the UTF-8 specification for your file.

0
source

All Articles