Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
#!perl
use DBI;
my $dsn = 'dbi:mysql(charset=>utf8mb4,RaiseError=>1):dbname=foo;host=localhost;';
my $dsa = [ DBI->parse_dsn($dsn) ];
my $charset = delete $dsa->[3]->{charset};
$dsn = sprintf("%s:%s(%s):%s", $dsa->[0], $dsa->[1], join(',', map { $_ . "=>" . $dsa->[3]->{$_} } keys %{ $dsa->[3] }), $dsa->[4]);
use Data::Dumper;
warn Dumper [$dsn, $charset];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.