1 2 3 4
use utf8; ... ... $dbh->do( "SET PASSWORD FOR 'test_user'\@'localhost'=PASSWORD('ööö')" );
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
#!/usr/local/bin/perl use warnings; use strict; use 5.10.1; use utf8; use open qw( :encoding(UTF-8) :std ); use DBI; use Term::ReadPassword; my $user = 'test_user'; my $passwd = read_password( 'Enter password: ', 0, 1 ); #print 'Enter password: '; #my $passwd = <>; #chomp $passwd; say "|$passwd|"; my $dbh = DBI->connect( "DBI:mysql:dbname=information_schema", $user, $passwd, { PrintError => 0, RaiseError => 1, AutoCommit => 1, mysql_enable_utf8 => 1, } ) or die DBI->errstr;
Quote|ööö|
Quote|ööö|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#!/usr/bin/env perl use warnings; use strict; use 5.10.1; use utf8; use open qw( :encoding(UTF-8) :std ); use Devel::Peek; use Term::ReadPassword; use Term::ReadLine; my $term = Term::ReadLine->new( 'table_watch', *STDIN, *STDOUT ); $term->ornaments( 0 ); print 'Enter: '; my $a = <>; chomp $a; my $b = read_password( 'Enter: ', 0, 1 ); my $c = $term->readline( 'Enter: ' ); Dump $a; Dump $b; Dump $c; say $a; say $b; say $c;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Enter: ü
Enter:
Enter: ü
SV = PV(0x1294100) at 0x13f4118
REFCNT = 1
FLAGS = (PADMY,POK,pPOK,UTF8)
PV = 0x141b390 "\303\274"\0 [UTF8 "\x{fc}"]
CUR = 2
LEN = 80
SV = PV(0x11f05c0) at 0x13f20c8
REFCNT = 1
FLAGS = (PADMY,POK,pPOK)
PV = 0x159f020 "\303\274"\0
CUR = 2
LEN = 16
SV = PV(0x11f0420) at 0x13f1fc0
REFCNT = 1
FLAGS = (PADMY,POK,pPOK)
PV = 0x1593100 "\374"\0
CUR = 1
LEN = 16
ü
ü
ü
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
#!/usr/bin/env perl use warnings; use strict; use 5.10.1; use utf8; use open qw( :encoding(UTF-8) :std ); use Devel::Peek; use Term::ReadPassword; use Term::ReadLine; my $term = Term::ReadLine->new( 'table_watch', *STDIN, *STDOUT ); $term->ornaments( 0 ); print 'Enter: '; my $a = <>; chomp $a; my $b = read_password( 'Enter: ', 0, 1 ); use Encode qw(decode_utf8); $b = decode_utf8( $b ); my $c = $term->readline( 'Enter: ' ); utf8::upgrade( $c ); Dump $a; Dump $b; Dump $c; say $a; say $b; say $c;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Enter: Ð
Enter:
Enter: Ð
SV = PV(0x27a2610) at 0x2902628
REFCNT = 1
FLAGS = (PADMY,POK,pPOK,UTF8)
PV = 0x2618c60 "\303\220"\0 [UTF8 "\x{d0}"]
CUR = 2
LEN = 80
SV = PV(0x26fead0) at 0x29005d8
REFCNT = 1
FLAGS = (PADMY,POK,pPOK,UTF8)
PV = 0x2aae310 "\303\220"\0 [UTF8 "\x{d0}"]
CUR = 2
LEN = 16
SV = PV(0x26fe910) at 0x2900548
REFCNT = 1
FLAGS = (PADMY,POK,pPOK,UTF8)
PV = 0x2929dd0 "\303\220"\0 [UTF8 "\x{d0}"]
CUR = 2
LEN = 16
Ð
Ð
Ð