utf 8 - ZF2 Doctrine2 MySql charset error -


i've setup mysql db utf8_unicode_ci collation, , tables , columns on have de same collation.

my doctrine config have set names utf8 connection option , html files use utf8 charset.

the text saved on tables contain accented characters (á,è,etc).

the problem when save content db, saves strange characters, when try save iso in utf8 table. (e.g.: notícias)

the workaround i've found to, utf8_decode before save, , utf8_encode before printing.

that means that, reason, in between messing utf8 iso.

what might be?

thanks.

edit:

i've setup encode before saving , decode before printing, , prints correctly in db chars change to:

xptÓ -> xptÓ

this makes searching in db "xptÓ" impossible...

i print bin2hex($string); @ each step of original workflow (i.e. without encode/decode steps).

go through each of:

  1. the raw $_post data
  2. the values after form validation
  3. the values put in bound entity
  4. the values you'd db if query directly using pdo (get from
    $em->getconnection())
  5. the values populated entity on reload (can via $em->detach($entity); $entity = $em->find('entity', $id);)

you'd looking @ point @ output changes, , focus search there.

i double check:

  • on db: show create table 'table' shows charset=utf8 whole table (and nothing different individual columns)
  • that tool use see database values (navicat, phpmyadmin) has got correct encoding set.

Comments

Popular posts from this blog

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

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -