encoding - PHP: Special chars not shown correctly -
i have value (name) stored in pg database, value müller
. however, example when var_dump('müller');
output : mÃ1/4ller
.
i've tried setting header('content-type: text/html; charset=utf-8');
, no go.
funny thing is, i'm not getting issue on client side, name displaying correctly, on server end, when breaking first 3 letters of name instead of getting:
array(3) { [0] => string(1) "m" [1] => string(1) "ü" [2] => string(1) "l" }
i get:
array(3) { [0] => string(1) "m" [1] => string(1) "Ã" [2] => string(1) "1/4" }
i figure since database storing value correctly, must php thing, haven't been able figure out after quite bit of googling, maybe not searching correct query?
it depends on schema configuration.
try utf8_decode()
before dumping php. http://php.net/manual/fr/function.utf8-decode.php
alternatively can use utf8_encode()
, encode string utf8
Comments
Post a Comment