Skip to content

Instantly share code, notes, and snippets.

@skaufman-socialflow
Created June 9, 2016 15:52
Show Gist options
  • Save skaufman-socialflow/67a6e797a29aa37f221fb142f1c402f2 to your computer and use it in GitHub Desktop.
Save skaufman-socialflow/67a6e797a29aa37f221fb142f1c402f2 to your computer and use it in GitHub Desktop.
--- Mon Jun 08 2015
17:48 < skaufman> jegade: if you are poking around ::Fixtures, try debugging near
17:48 < skaufman> https://metacpan.org/source/SKAUFMAN/DBIx-Class-Fixtures-1.001032/lib/DBIx/Class/Fixtures.pm#L851
17:48 < skaufman> $ds->title should be a wide string
17:49 < skaufman> if is UTf-8 encoded there, then it's wrong
17:49 < skaufman> i just broke into a repl if $title matched 'Chars'
17:52 < jegade> skaufman: ok, then i should remove mysql_enable_utf8?
17:53 < jegade> this is setting the strings to utf8 encoding
17:54 < skaufman> jegade: nah i think you should leave that in,
17:54 < skaufman> but from the docs it looks like DBD::mysql does some other things to check if it should be UTF-8 decoded on the way out
17:54 < skaufman> based on the db's encoding settings
17:54 < skaufman> so first of all make sure you're on the latest DBD::mysql
17:55 < skaufman> then probably just try to see why stuff is not coming back UTF-8 decoded
17:55 < skaufman> When set, a data retrieved from a textual column type (char, varchar, etc) will have the UTF-8 flag turned on if necessary.
17:55 < skaufman> the 'if neccesary' is a bit fishy
18:00 < skaufman> also might want to dig around in this test
18:00 < skaufman> https://metacpan.org/source/CAPTTOFU/DBD-mysql-4.032_01/t/55utf8.t
18:50 < jegade> skaufman: is the problem at dumping or population the fixtures? just to be sure i understand it right
18:51 < skaufman> jegade: at dumping
18:51 < skaufman> er sorry
18:51 < skaufman> jegade: it populates in that lib
18:51 < skaufman> then it dumps
18:51 < skaufman> then it installs the fixtures
18:51 < skaufman> so the populate seems fine,
18:52 < skaufman> then it pulls the data out,
18:52 < skaufman> at that point it is not a wide string
18:52 < skaufman> which it should be
18:52 < skaufman> then it dumps it to file UTF-8 encoded,
18:52 < skaufman> reads it back UTF-8 encoded
18:52 < skaufman> and double encodes on the way in
18:52 < skaufman> at least thats what happens with sqlite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment