- Timestamp:
- 09/10/08 19:17:33 (5 years ago)
- Location:
- lang/perl/Google-Chart/trunk
- Files:
-
- 2 modified
-
lib/Google/Chart/Type/QRcode.pm (modified) (2 diffs)
-
t/53_qrcode.t (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Google-Chart/trunk/lib/Google/Chart/Type/QRcode.pm
r18923 r19128 4 4 use Moose; 5 5 use Moose::Util::TypeConstraints; 6 use Encode (); 6 7 7 8 enum 'Google::Chart::Type::QRcode::Encoding' => qw(shift_jis utf-8 iso-8859-1); … … 51 52 my $self = shift; 52 53 my %data = ( 53 cht => 'qr', 54 chl => $self->text, 54 cht => 'qr', 55 chl => Encode::is_utf8($self->text) ? 56 Encode::decode_utf8($self->text) : $self->text, 55 57 choe => $self->encoding, 56 58 chld => $self->eclevel || $self->margin ? -
lang/perl/Google-Chart/trunk/t/53_qrcode.t
r16838 r19128 1 1 use strict; 2 use Test::More (tests => 5); 2 use utf8; 3 use Test::More (tests => 9); 3 4 use Test::Exception; 4 5 … … 27 28 my %h = $uri->query_form; 28 29 is( $h{cht}, "qr" ); 30 } 29 31 32 { 33 my $chart = Google::Chart->new( 34 type => { 35 module => "QRcode", 36 args => { 37 text => Encode::encode_utf8("諸行無常") 38 } 39 } 40 ); 41 42 ok( $chart ); 43 isa_ok( $chart, "Google::Chart" ); 44 45 isa_ok( $chart->type, "Google::Chart::Type::QRcode" ); 46 47 my $uri = $chart->as_uri; 48 diag $uri; 49 my %h = $uri->query_form; 50 is( $h{cht}, "qr" ); 30 51 } 52
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)