Issue in urlencoding using MySQL/PHP -
i have few textfiles input mysql database. these textfiles contain characters é , ë. have struggled getting data database , seems i've got right. however, know if there better way way describe here.
- the textfiles utf-8 encoded.
- the php scripts utf-8 encoded well. i've read important.
- all html output done using header this:
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
- the mysql database created using collation of latin1_swedish_ci (the character set left blank)
- all columns contain characters (varchar) defined using collation of latin1_swedish_ci
i assume right way store url encoded strings when see character é stored %c3%a9 in database. found mysql function urlencoding here. when open phpmyadmin see character é presented %c3%a3%c2%a9.
i can add statement replace characters in database, tells me there more efficient way achieve this.
any appreciated. in advance.
what missing list of 5 things is
- i tell mysql client bytes utf8-encoded. via
$mysqli_obj->set_charset('utf8');
ornew pdo('dblib:host=host;dbname=db;charset=utf8', $user, $pwd);
orset names utf8
. (or utf8mb4).
the client sees utf8, table sees latin1; conversion occur when inserting
, selecting
, needs #6 know so.
Comments
Post a Comment