view release on metacpan or search on metacpan
$dbh = DBI->connect("dbi:Sybase:charset=iso_1",
$user, $passwd);
The default charset used depends on the locale that the application runs
in. If you wish to interact with unicode varaiables (see syb_enable_utf8, below) then
you should set charset=utf8. Note however that this means that Sybase will expect all
data sent to it for char/varchar columns to be encoded in utf8 (e.g. sending iso8859-1 characters
like e-grave, etc).
=item language
=item syb_enable_utf8 (bool)
If this attribute is set then DBD::Sybase will convert UNIVARCHAR, UNICHAR,
and UNITEXT data to Perl's internal utf-8 encoding when they are
retrieved. Updating a unicode column will cause Sybase to convert any incoming
data from utf-8 to its internal utf-16 encoding.
This feature requires OpenClient 15.x to work.
Default: off
view all matches for this distribution
view release on metacpan or search on metacpan
my $ctsth = $dbh->prepare( 'CREATE TABLE alltypetst, NO FALLBACK (
col1 integer,
col2 smallint,
col3 byteint,
col4 char(20) character set unicode,
col5 varchar(100) character set unicode,
col6 float,
col7 decimal(2,1),
col8 decimal(4,2),
col9 decimal(8,4),
col10 decimal(14,5),
my $cmsth = $dbh->prepare(
'CREATE MACRO dbitest(col1 integer,
col2 smallint,
col3 byteint,
col4 char(20) character set unicode,
col5 varchar(100) character set unicode,
col6 float,
col7 decimal(2,1),
col8 decimal(4,2),
col9 decimal(8,4),
col10 decimal(14,5),
view all matches for this distribution
view release on metacpan or search on metacpan
* Added RPM spec file.
2006-11-26 [r542] Chad Wagner <chad.wagner@gmail.com>
* Added 50unicode.t to MANIFEST.
2006-11-26 [r541] Chad Wagner <chad.wagner@gmail.com>
* Changed SQL_WVARCHAR and SQL_WCHAR to use SQL_C_BINARY data type.
* Added unicode test cases.
2006-11-26 [r540] Chad Wagner <chad.wagner@gmail.com>
* Added a few more test cases.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBD/Unify.pm view on Meta::CPAN
# man DBI for explanation of each method (there's more than listed here)
$dbh = DBI->connect ("DBI:Unify:[\$dbname]", "", $schema, {
AutoCommit => 0,
ChopBlanks => 1,
uni_unicode => 0,
uni_verbose => 0,
uni_scanlevel => 2,
});
$dbh = DBI->connect_cached (...); # NYT
$dbh->do ($statement);
lib/DBD/Unify.pm view on Meta::CPAN
sub private_attribute_info {
return {
dbd_verbose => undef,
uni_verbose => undef,
uni_unicode => undef,
};
} # private_attribute_info
sub ping {
my $dbh = shift;
lib/DBD/Unify.pm view on Meta::CPAN
By default, this driver is completely Unicode unaware: what you put into
the database will be returned to you without the encoding applied.
To enable automatic decoding of UTF-8 when fetching from the database,
set the C<uni_unicode> attribute to a true value for the database handle
(statement handles will inherit) or to the statement handle.
$dbh->{uni_unicode} = 1;
When CHAR or TEXT fields are retrieved and the content fetched is valid
UTF-8, the value will be marked as such.
=item re-connect
view all matches for this distribution
view release on metacpan or search on metacpan
DBIc_set(imp_dbh, DBIcf_AutoCommit, SvTRUE(valuesv));
return TRUE;
}
else if (strncmp(key, "NoUTF8Flag", 10) == 0)
{
warn("NoUTF8Flag is deprecated due to perl unicode weirdness\n");
if (SvTRUE(valuesv)) {
imp_dbh->no_utf8_flag = TRUE;
}
else {
imp_dbh->no_utf8_flag = FALSE;
view all matches for this distribution
view release on metacpan or search on metacpan
* just remove unnecessary "my" - https://github.com/CaptTofu/DBD-mysql/pull/34 - Shoichi Kaji
* eval $ExtUtils::MakeMaker::VERSION requires for old ExtUtils::MakeMaker - https://github.com/CaptTofu/DBD-mysql/pull/32 - Daisuke Murase
* Updated documentation to reflect that bugs will be reported at rt.cpan.org
* Updated version
* Chased tail finding issue with -1 being converted to max unsigned int in PS mode
* Various typos and other unicode fixes dsteinbrunner <dsteinbrunner@gmail.com>
* Fixed permissions on files.
* Clarified documentation and bumped version for next release
2012-08-28 Patrick Galbraith et open source community <patg at patg dot net> (4.022)
* Fixes for Win32 from Rom Hoelz (https://github.com/hoelzro)
view all matches for this distribution
view release on metacpan or search on metacpan
/* Check if a collation is using UTF-8
*
* To get the ID's:
* SELECT ID FROM information_schema.COLLATIONS WHERE CHARACTER_SET_NAME LIKE
* 'utf8%' ORDER BY IS_DEFAULT DESC, COLLATION_NAME LIKE '%\_general\_%' DESC,
* COLLATION_NAME LIKE '%\_bin%' DESC, COLLATION_NAME LIKE '%\_unicode\_%' DESC,
* COLLATION_NAME LIKE 'utf8mb4_0900\_%' DESC
*
* Note that default and generic collations are moved to the front of the list
*/
bool dbd_mysqlx_is_utf8_collation(uint16_t collation) {
view all matches for this distribution
view release on metacpan or search on metacpan
ALL - turn on all DBI and driver flags (not recommended)
SQL - trace SQL statements executed
(not yet implemented in DBI but implemented in some DBDs)
CON - trace connection process
ENC - trace encoding (unicode translations etc)
(not yet implemented in DBI but implemented in some DBDs)
DBD - trace only DBD messages
(not implemented by all DBDs yet)
TXN - trace transactions
(not implemented in all DBDs yet)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBICx/TestDatabase.pm view on Meta::CPAN
(undef, $filename) = tempfile;
push @TMPFILES, $filename;
}
my $schema = $schema_class->connect( "DBI:SQLite:$filename", '', '',
{ sqlite_unicode => 1 } )
or die "failed to connect to DBI:SQLite:$filename ($schema_class)";
$schema->deploy unless $opts->{nodeploy};
return $schema;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/Admin/TableInfo.pm view on Meta::CPAN
use Text::Table::Manifold ':constants';
# ---------------------
my($attr) = {};
$$attr{sqlite_unicode} = 1 if ($ENV{DBI_DSN} =~ /SQLite/i);
my($dbh) = DBI -> connect($ENV{DBI_DSN}, $ENV{DBI_USER}, $ENV{DBI_PASS}, $attr);
my($vendor_name) = uc $dbh -> get_info(17);
my($info) = DBIx::Admin::TableInfo -> new(dbh => $dbh) -> info;
$dbh -> do('pragma foreign_keys = on') if ($ENV{DBI_DSN} =~ /SQLite/i);
lib/DBIx/Admin/TableInfo.pm view on Meta::CPAN
align_left,
align_left,
align_left,
align_left,
],
format => format_text_unicodebox_table,
headers => \@header,
join => "\n",
);
my(%type) =
(
view all matches for this distribution
view release on metacpan or search on metacpan
my $dir = tempdir(CLEANUP => 1);
my (undef, $db) = tempfile(DIR => $dir, SUFFIX => '.db');
my $dbh = DBI->connect(
"dbi:SQLite:dbname=$db" , '', '', {
sqlite_unicode => 1,
},
);
$dbh->do('CREATE TABLE item (
id INTEGER PRIMARY KEY AUTOINCREMENT,
view all matches for this distribution
view release on metacpan or search on metacpan
Debian_CPANTS.txt view on Meta::CPAN
"libtree-dagnode-perl", "Tree-DAG_Node", "1.06", "0", "0"
"libtree-redblack-perl", "Tree-RedBlack", "0.5", "0", "0"
"libtree-simple-perl", "Tree-Simple", "1.18", "0", "0"
"libtree-simple-visitorfactory-perl", "Tree-Simple-VisitorFactory", "0.10", "0", "0"
"libtry-tiny-perl", "Try-Tiny", "0.02", "0", "0"
"libunicode-map-perl", "Unicode-Map", "0.112", "1", "0"
"libunicode-map8-perl-dfsg", "Unicode-Map8", "0.12", "0", "0"
"libunicode-maputf8-perl", "Unicode-MapUTF8", "1.11", "0", "0"
"libunicode-string-perl", "Unicode-String", "2.09", "0", "0"
"libuniversal-can-perl", "UNIVERSAL-can", "1.15", "0", "0"
"libuniversal-isa-perl", "UNIVERSAL-isa", "1.02", "0", "0"
"libuniversal-moniker-perl", "UNIVERSAL-moniker", "0.08", "0", "0"
"libuniversal-require-perl", "UNIVERSAL-require", "0.13", "0", "0"
"libunix-syslog-perl", "Unix-Syslog", "1.1", "0", "0"
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/DBICTest.pm view on Meta::CPAN
my $dbuser = $args{"user"} || '';
my $dbpass = $args{"pass"} || '';
my $schema;
my @connect_info = ($dsn, $dbuser, $dbpass, { AutoCommit => 1, sqlite_unicode => 1 });
if ($args{compose_connection}) {
$schema = DBICTest::Schema->compose_connection(
'DBICTest', @connect_info
);
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/I18NTest.pm view on Meta::CPAN
$schema_class ||= 'I18NTest::Schema';
eval "require $schema_class"
or die "failed to require $schema_class: $@";
my $schema = $schema_class->connect("DBI:SQLite::memory:",'','', { sqlite_unicode => 1 })
or die "failed to connect to DBI:SQLite::memory: ($schema_class)";
$schema->deploy;
return $schema;
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/testlib/TestDB.pm view on Meta::CPAN
my $dbh = DBI->connect(
"dbi:SQLite:dbname=:memory:",
"", "",
{ RaiseError => 1,
sqlite_unicode => 1,
}
);
$dbh->do( "
CREATE TABLE test (
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/DBICTest.pm view on Meta::CPAN
my $dsn = $ENV{"DBICTEST_DSN"} || "dbi:SQLite:${db_file}";
my $dbuser = $ENV{"DBICTEST_DBUSER"} || '';
my $dbpass = $ENV{"DBICTEST_DBPASS"} || '';
my @connect_info = ($dsn, $dbuser, $dbpass, { AutoCommit => 1, sqlite_unicode => 1, %args });
return @connect_info;
}
sub init_schema {
view all matches for this distribution
view release on metacpan or search on metacpan
t/00-report-prereqs.t
t/basic.t
t/lib/TestSchema.pm
t/lib/TestSchema.sql
t/lib/TestSchema/Result/Foo.pm
t/unicode.t
xt/author/00-compile.t
xt/author/changes_has_content.t
xt/author/clean-namespaces.t
xt/author/eol.t
xt/author/kwalitee.t
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/Class/ResultDDL.pm view on Meta::CPAN
# Same API for the others
nchar ... data_type => 'nchar' ...
bit ... data_type => 'bit' ...
C<nchar> (SQL Server unicode char array) has an identical API but
returns C<< data_type => 'nchar' >>
Note that Postgres allows C<"bit"> to have a size, like C<char($size)> but SQL Server
uses C<"bit"> only to represent a single bit.
lib/DBIx/Class/ResultDDL.pm view on Meta::CPAN
# MySQL specific variants:
tinytext data_type => 'tinytext', size => 0xFF
mediumtext data_type => 'mediumtext', size => 0xFFFFFF
longtext data_type => 'longtext', size => 0xFFFFFFFF
# SQL Server unicode variant:
ntext data_type => 'ntext', size => 0x3FFFFFFF
ntext($size) data_type => 'ntext', size => $size
See MySQL notes in C<blob>. For SQL Server, you might want C<ntext> or C<< nvarchar(MAX) >>
instead. Postgres does not use a size, and allows arrays of this type.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/Class/Schema/Loader/DBI/InterBase.pm view on Meta::CPAN
if ($sub_type_name eq 'BINARY') {
$info->{data_type} = 'blob';
}
elsif ($sub_type_name eq 'TEXT') {
if (defined $char_set_id && $char_set_id == 3) {
$info->{data_type} = 'blob sub_type text character set unicode_fss';
}
else {
$info->{data_type} = 'blob sub_type text';
}
}
lib/DBIx/Class/Schema/Loader/DBI/InterBase.pm view on Meta::CPAN
if ($data_type =~ /^(?:char|varchar)\z/) {
$info->{size} = $char_length;
if (defined $char_set_id && $char_set_id == 3) {
$info->{data_type} .= '(x) character set unicode_fss';
}
}
elsif ($data_type !~ /^(?:numeric|decimal)\z/) {
delete $info->{size};
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Pod/Markdown.pm view on Meta::CPAN
$section =~ s/^\s+//;
$section =~ s/\s+$//;
$section =~ tr/ /_/;
$section =~ tr/\x00-\x1F\x80-\x9F//d if 'A' eq chr(65); # drop crazy characters
#$section = $self->unicode_escape_url($section);
# unicode_escape_url {
$section =~ s/([^\x00-\xFF])/'('.ord($1).')'/eg;
# Turn char 1234 into "(1234)"
# }
$section = '_' unless length $section;
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/Role/MySQL.pm view on Meta::CPAN
my $self = shift;
no warnings 'once'; # prevent: "Test::mysqld::errstr" used only once
my $mysqld = Test::mysqld->new(
my_cnf => {
'character-set-server' => 'utf8',
'collation-server' => 'utf8_unicode_ci',
'skip-networking' => '',
}
) or die $Test::mysqld::errstr;
return $mysqld;
}
view all matches for this distribution
view release on metacpan or search on metacpan
0.1.3
* Pass plain "BLOB" type as binary.
0.1.2
* Fix breaking of non-ASCII unicode in previous release.
0.1.1
* Pass BLOBs correctly.
* Make Kwalitee happier.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/Class.pm view on Meta::CPAN
# as the distbuild-time injected author list is utf8 encoded
# Without this pod2text output is less than ideal
#
# A bit regarding selection/compatiblity:
# Before 5.8.7 UTF-8 was == utf8, both behaving like the (lax) utf8 we know today
# Then https://www.nntp.perl.org/group/perl.unicode/2004/12/msg2705.html happened
# Encode way way before 5.8.0 supported UTF-8: https://metacpan.org/source/DANKOGAI/Encode-1.00/lib/Encode/Supported.pod#L44
# so it is safe for the oldest toolchains.
# Additionally we inject all the utf8 programattically and test its well-formedness
# so all is well
#
view all matches for this distribution
view release on metacpan or search on metacpan
{
{
my $dbi = DBIx::Custom->connect(
dsn => 'dbi:SQLite:dbname=:memory:',
option => {
$DBD::SQLite::VERSION > 1.26 ? (sqlite_unicode => 1) : (unicode => 1)
}
);
my $binary = pack("I3", 1, 2, 3);
eval { $dbi->execute('drop table table1') };
$dbi->execute('create table table1(key1, key2)');
}
{
my $dbi = DBIx::Custom->connect(
dsn => 'dbi:SQLite:dbname=:memory:',
option => {
$DBD::SQLite::VERSION > 1.26 ? (sqlite_unicode => 1) : (unicode => 1)
}
);
my $binary = pack("I3", 1, 2, 3);
eval { $dbi->execute('drop table table1') };
$dbi->execute('create table table1(key1, key2)');
view all matches for this distribution
view release on metacpan or search on metacpan
Sybase => 'server', ODBC => '', XBase => '');
my %kwportmap = (mysql => 'port', Pg => 'port');
my %kwutf8map = (mysql => 'mysql_enable_utf8',
Pg => 'pg_enable_utf8',
SQLite => 'sqlite_unicode',
Sybase => 'syb_enable_utf8');
# Whether the DBMS supports transactions
my %transactmap = (mSQL => 0, mysql => 0, Pg => 1, Sybase => 'server',
ODBC => 0, XBase => 0);
view all matches for this distribution
view release on metacpan or search on metacpan
t/02_utf8.t view on Meta::CPAN
note 'Text::CSV';
note sprintf(" %-${_column_width}s : %s", 'VERSION', Text::CSV->VERSION);
note sprintf(" %-${_column_width}s : %s", 'Backend', Text::CSV->module);
note sprintf(" %-${_column_width}s : %s", 'Backend::VERSION', Text::CSV->version);
my $dbh = DBI->connect("dbi:SQLite::memory:", '', '', {RaiseError => 1, sqlite_unicode => 1}) or die 'cannot connect to db';
$dbh->do(q{
CREATE TABLE item (
id INTEGER PRIMARY KEY,
name VARCHAR(255)
);
view all matches for this distribution
view release on metacpan or search on metacpan
pad_sv|||
pad_swipe|||
pad_tidy|||
pad_undef|||
parse_body|||
parse_unicode_opts|||
path_is_absolute|||
peep|||
pending_ident|||
perl_alloc_using|||n
perl_alloc|||n
view all matches for this distribution
view release on metacpan or search on metacpan
my $file = shift || ':memory:';
DBI->connect('dbi:SQLite:'.$file,'','',{
RaiseError => 1,
PrintError => 0,
AutoCommit => 1,
sqlite_unicode => 1,
});
}
1;
view all matches for this distribution
view release on metacpan or search on metacpan
t/01records.t view on Meta::CPAN
($val,$msg) = $rec->SetName('1234567890123456789012345678901234567890');
ok(!$val, $msg);
is($msg, 'That is already the current value', 'No update for same value');
is($rec->Name, '12345678901234', "Value is the same");
# Test unicode truncation:
my $univalue = "鿝忏¬è©¦";
($val,$msg) = $rec->SetName($univalue.$univalue);
ok($val, $msg) ;
is($rec->Name, '鿝忏¬');
view all matches for this distribution