Afaik, 'mysql_enable_utf8 => 1' (and there are similar options for
Postgress and SQLite at least) just tells the mysql driver that if a column
is marked as having a UTF8 charset in the table, it'll try to return the
data as such. If your column has a different character set the option won't
do much, nor would it be active if your data isn't marked UTF8 or not
inserted as UTF8 properly.

You certainly don't need two database handles to solve this problem. The
difficulty lies in making sure you're converting the right character data
to the right character data, no matter where you do this (you can do it in
the database itself just as well). Two database handles won't make that bit
any easier.

Also, afaik the recommended way to connect is with a single hash ref:
My::Schema->connect({
    dsn => 'dbi:mysql:database=db;hostname=localhost;port=3306',
    user => 'username',
    pass => 'password',
    mysql_enable_utf8 => 1,
    AutoCommit => 1,
});




On 16 January 2014 16:07, Bill Moseley <mose...@hank.org> wrote:

>
> On Thu, Jan 16, 2014 at 7:25 AM, Dave Howorth 
> <dhowo...@mrc-lmb.cam.ac.uk>wrote:
>
>> Lianna Eeftinck wrote:
>> >> I'm open to any suggestions, but for now it looks like the
>> >> two-connection approach solves my problem.
>> >
>> > You never stated the problem you are trying to tackle with the two
>> > connections. :)
>>
>> You're right. I want to read data from a MySQL database where some
>> tables use Windows-1252 encoding (i.e what MySQL refers to as latin1)
>> and others use UTF8.
>>
>
> It's not latin1.   There's a few differences:
>
> http://www.i18nqa.com/debug/table-iso8859-1-vs-windows-1252.html
> http://www.i18nqa.com/debug/bug-iso8859-1-vs-windows-1252.html
>
> http://www.string-functions.com/encodingtable.aspx?encoding=28591&decoding=1252
>
> How are you going to join across those two database handles?
>
> Dave, I know it sounds like a lot of work, but fix your data.   It is so
> much easier to do it right now than spend years fighting bugs and broken
> code.   I'm not sure what your project is, but it gets very expensive
> carrying along this kind of tech debt.
>
>
>
>
> --
> Bill Moseley
> mose...@hank.org
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive:
> http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk
>
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

Reply via email to