neitanod / forceutf8

PHP Class Encoding featuring popular Encoding::toUTF8() function --formerly known as forceUTF8()-- that fixes mixed encoded strings.
1.63k stars 369 forks source link

Some characters not correctly decoded ? #59

Closed gordielachance closed 7 years ago

gordielachance commented 7 years ago

Hi, is it possible that the characters “ ” are not correctly decoded ?

Krato commented 7 years ago

Yes. This is giving me an error too.

neitanod commented 7 years ago

Not likely. What encoding are you using in the input?

M13K commented 7 years ago

what if you don't know what encoding used in the input. I have a csv file with an unknown charset, then i've applied the Encoding::toUTF8. Unfortunately, it does'nt work...

neitanod commented 7 years ago

ForceUTF8 will process your file correctly as long as it's encoded in Latin1 (iso 8859-1), Windows-1252 or UTF8, or mix of them. ForceUTF8 does not understand other encondings.

M13K commented 7 years ago

Ok, thanks you for the reply! Hope to find what i'm looking for. Good job by the way..

stamster commented 7 years ago

@neitanod supported encodings should be clearly listed in a documentation.

ATM:

You don't need to know what the encoding of your strings is. It can be Latin1 (iso 8859-1), Windows-1252 or UTF8, or the string can have a mix of them. \ForceUTF8\Encoding::toUTF8() will convert everything to UTF8.

neitanod commented 7 years ago

Right. I initially wrote it for my own needs but it's probably time to write a better documentation now that the user base has grown. :)