Changeset 12592 for lang/perl/Sledge-Plugin-JSON-XS
- Timestamp:
- 05/28/08 15:25:46 (5 years ago)
- Location:
- lang/perl/Sledge-Plugin-JSON-XS/trunk
- Files:
-
- 2 modified
-
lib/Sledge/Plugin/JSON/XS.pm (modified) (2 diffs)
-
t/01_basic.t (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Sledge-Plugin-JSON-XS/trunk/lib/Sledge/Plugin/JSON/XS.pm
r6339 r12592 4 4 use 5.00800; 5 5 use JSON::XS; 6 use Encode (); 6 7 7 8 our $VERSION = '0.01'; … … 50 51 sub _add_callback { 51 52 my ($self, $cb, $json) = @_; 53 54 if (Encode::is_utf8($cb)) { 55 $cb = Encode::encode('utf8', $cb); 56 } 52 57 53 58 my $output; -
lang/perl/Sledge-Plugin-JSON-XS/trunk/t/01_basic.t
r6339 r12592 1 1 use strict; 2 2 use warnings; 3 use Test::More tests => 10; 3 use Test::More tests => 12; 4 use Encode; 4 5 5 6 # ------------------------------------------------------------------------- … … 146 147 ); 147 148 149 test( 150 'callback_flagged_utf8', 151 sub { 152 $REQ_HASH = { callback => decode_utf8('hoge') }; 153 }, 154 sub { 155 is_ex $page->r->{'print'}, 'hoge({"foo":"bar"});'; 156 ok( (!Encode::is_utf8($page->r->{'print'})), 'not flagged'); 157 }, 158 ); 159
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)