1DBIx::Class::UTF8ColumnUss(e3r)Contributed Perl DocumentDaBtIixo:n:Class::UTF8Columns(3)
2
3
4
6 DBIx::Class::UTF8Columns - Force UTF8 (Unicode) flag on columns
7 (DEPRECATED)
8
10 package Artist;
11 use base 'DBIx::Class::Core';
12
13 __PACKAGE__->load_components(qw/UTF8Columns/);
14 __PACKAGE__->utf8_columns(qw/name description/);
15
16 # then belows return strings with utf8 flag
17 $artist->name;
18 $artist->get_column('description');
19
21 This module allows you to get and store utf8 (unicode) column data in a
22 database that does not natively support unicode. It ensures that column
23 data is correctly serialised as a byte stream when stored and de-
24 serialised to unicode strings on retrieval.
25
26 THE USE OF THIS MODULE (AND ITS COUSIN DBIx::Class::ForceUTF8) IS VERY
27 STRONGLY DISCOURAGED, PLEASE READ THE WARNINGS BELOW FOR AN EXPLANATION.
28
29 If you want to continue using this module and do not want to receive
30 further warnings set the environment variable "DBIC_UTF8COLUMNS_OK" to
31 a true value.
32
33 Warning - Module does not function properly on create/insert
34 Recently (April 2010) a bug was found deep in the core of DBIx::Class
35 which affects any component attempting to perform encoding/decoding by
36 overloading store_column and get_columns. As a result of this problem
37 create sends the original column values to the database, while update
38 sends the encoded values. DBIx::Class::UTF8Columns and
39 DBIx::Class::ForceUTF8 are both affected by this bug.
40
41 It is unclear how this bug went undetected for so long (it was
42 introduced in March 2006), No attempts to fix it will be made while the
43 implications of changing such a fundamental behavior of DBIx::Class are
44 being evaluated. However in this day and age you should not be using
45 this module anyway as Unicode is properly supported by all major
46 database engines, as explained below.
47
48 If you have specific questions about the integrity of your data in
49 light of this development - please join us on IRC or the mailing list
50 to further discuss your concerns with the team.
51
52 Warning - Native Database Unicode Support
53 If your database natively supports Unicode (as does SQLite with the
54 "sqlite_unicode" connect flag, MySQL with "mysql_enable_utf8" connect
55 flag or Postgres with the "pg_enable_utf8" connect flag), then this
56 component should not be used, and will corrupt unicode data in a subtle
57 and unexpected manner.
58
59 It is far better to do Unicode support within the database if possible
60 rather than converting data to and from raw bytes on every database
61 round trip.
62
63 Warning - Component Overloading
64 Note that this module overloads "store_column" in DBIx::Class::Row in a
65 way that may prevent other components overloading the same method from
66 working correctly. This component must be the last one before
67 DBIx::Class::Row (which is provided by DBIx::Class::Core). DBIx::Class
68 will detect such incorrect component order and issue an appropriate
69 warning, advising which components need to be loaded differently.
70
72 Template::Stash::ForceUTF8, DBIx::Class::UUIDColumns.
73
75 utf8_columns
77 get_column
78 get_columns
79 store_column
81 Check the list of additional DBIC resources.
82
84 This module is free software copyright by the DBIx::Class (DBIC)
85 authors. You can redistribute it and/or modify it under the same terms
86 as the DBIx::Class library.
87
88
89
90perl v5.34.0 2022-01-21 DBIx::Class::UTF8Columns(3)