What character encoding is c3 82 c2 bf?

Viewed 14737

I have a source of text data that includes the byte sequence c3 82 c2 bf. In context I think it's supposed to be a capital Greek Phi symbol (Φ).

Anyway I can't figure out what encoding is being used; I'm writing a Python script to process this data into a database that expects Unicode, and it throws an exception on this particular sequence of data.

Any suggestions on how to handle it?

5 Answers

I don't know the reason. But maybe there is a possible scenary.

binary x0xx is converted to 0xC2 x0xx

binary x1xx is converted to 0xC3 x0xx

So there are lots of c2 and c3 added.

Where does this happen? Send non ascii in url query string for an ajax call, the Flask server will do this.

i have received this character \xc3\x82 from external utf-16 document after conversion to utf-8 using $str = mb_convert_encoding($content, "UTF-8" , "UTF-16LE"); (PHP)

original sequence was 0xA0 0x00 and the converter converted it probably to what it meant to be NBSP .. it was character at thousands separator in currency number. nbsp is \xc2\xa0 so right now i have thousands removal as:

$price = str_replace(["\xc2\xa0","\xc3\x82"], '', $price);
Related