X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FUTF8Columns.pm;h=793c1bc9b36613edd9d876a1e1a1d1d12af75003;hb=372b98a6eaaca008a75f826bf75347537f4c866b;hp=63471e92d6a42c6216e86c52022ecf711f63b3e8;hpb=7c14c3cf3b25759613e2ecef2e2b50029b555745;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/UTF8Columns.pm b/lib/DBIx/Class/UTF8Columns.pm index 63471e9..793c1bc 100644 --- a/lib/DBIx/Class/UTF8Columns.pm +++ b/lib/DBIx/Class/UTF8Columns.pm @@ -7,10 +7,7 @@ __PACKAGE__->mk_classdata( '_utf8_columns' ); =head1 NAME -DBIx::Class::UTF8Columns - Force UTF8 (Unicode) flag on columns - - Please ensure you understand the purpose of this module before use. - Read the warnings below to prevent data corruption through misuse. +DBIx::Class::UTF8Columns - Force UTF8 (Unicode) flag on columns (DEPRECATED) =head1 SYNOPSIS @@ -31,6 +28,36 @@ in a database that does not natively support unicode. It ensures that column data is correctly serialised as a byte stream when stored and de-serialised to unicode strings on retrieval. + THE USE OF THIS MODULE (AND ITS COUSIN DBIx::Class::ForceUTF8) IS VERY + STRONGLY DISCOURAGED, PLEASE READ THE WARNINGS BELOW FOR AN EXPLANATION. + +If you want to continue using this module and do not want to receive +further warnings set the environment variable C +to a true value. + +=head2 Warning - Module does not function properly on create/insert + +Recently (April 2010) a bug was found deep in the core of L +which affects any component attempting to perform encoding/decoding by +overloading L and +L. As a result of this problem +L sends the original column values +to the database, while L sends the +encoded values. L and L +are both affected by this bug. + +It is unclear how this bug went undetected for so long (it was +introduced in March 2006), No attempts to fix it will be made while the +implications of changing such a fundamental behavior of DBIx::Class are +being evaluated. However in this day and age you should not be using +this module anyway as Unicode is properly supported by all major +database engines, as explained below. + +If you have specific questions about the integrity of your data in light +of this development - please +L +to further discuss your concerns with the team. + =head2 Warning - Native Database Unicode Support If your database natively supports Unicode (as does SQLite with the @@ -40,8 +67,8 @@ then this component should B be used, and will corrupt unicode data in a subtle and unexpected manner. It is far better to do Unicode support within the database if -possible rather convert data into and out of the database on every -round trip. +possible rather than converting data to and from raw bytes on every +database round trip. =head2 Warning - Component Overloading @@ -116,7 +143,7 @@ sub get_columns { sub store_column { my ( $self, $column, $value ) = @_; - # the dirtyness comparison must happen on the non-encoded value + # the dirtiness comparison must happen on the non-encoded value my $copy; if ( defined $value and $self->_is_utf8_column($column) and utf8::is_utf8($value) ) { @@ -135,13 +162,16 @@ sub _is_utf8_column { return ($_[0]->utf8_columns || {})->{$_[1]}; } -=head1 AUTHORS +=head1 FURTHER QUESTIONS? -See L. +Check the list of L. -=head1 LICENSE +=head1 COPYRIGHT AND LICENSE -You may distribute this code under the same terms as Perl itself. +This module is free software L +by the L. You can +redistribute it and/or modify it under the same terms as the +L. =cut