Dealing with strange encoding for PHP/MySQL import -


we daily upload of csv file client in utf16-le encoding. however, when run iconv('utf16-le', 'utf8') on each line of csv file, looks when going database:

z�a�a�0�7�3�7

ie, there's 1 of [?] things in between every character.

i tried utf8_encode , various combinations of iconv , different encoding types in order go away. has had experience , how convert unknown or unsupported encoding utf8, or @ least readable php , mysql?

half of characters in utf16 cannot converted utf8. utf16 takes addition 8 bits.

utf16 has, encoded each string, le or be. fun, try converting utf16 utf8 (no '-le'). tell if client lied le. it's case data doesn't fit.

one solution store byte arrays (binary(x)) in database, not text.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -