9 my $schema = DBICTest->init_schema();
11 DBICTest::Schema::CD->load_components('UTF8Columns');
12 DBICTest::Schema::CD->utf8_columns('title');
13 Class::C3->reinitialize();
15 my $cd = $schema->resultset('CD')->create( { artist => 1, title => 'øni', year => '2048' } );
16 my $utf8_char = 'uniuni';
19 ok( utf8::is_utf8( $cd->title ), 'got title with utf8 flag' );
20 ok(! utf8::is_utf8( $cd->year ), 'got year without utf8 flag' );
22 utf8::decode($utf8_char);
23 $cd->title($utf8_char);
24 ok(! utf8::is_utf8( $cd->{_column_data}{title} ), 'store utf8-less chars' );
27 my $v_utf8 = "\x{219}";
29 $cd->update ({ title => $v_utf8 });
31 ok( !$cd->is_column_changed('title'), 'column is not dirty after setting the same unicode value' );
33 $cd->update ({ title => $v_utf8 });
34 $cd->title('something_else');
35 ok( $cd->is_column_changed('title'), 'column is dirty after setting to something completely different');
38 local $TODO = 'There is currently no way to propagate aliases to inflate_result()';
39 $cd = $schema->resultset('CD')->find ({ title => $v_utf8 }, { select => 'title', as => 'name' });
40 ok (utf8::is_utf8( $cd->get_column ('name') ), 'utf8 flag propagates via as');