]>
Commit | Line | Data |
---|---|---|
3f9c8a96 TC |
1 | =head1 NAME |
2 | ||
3 | bse-unicode.pod - using unicode with BSE | |
4 | ||
5 | =head1 DESCRIPTION | |
6 | ||
7 | Using utf-8 with BSE is currently experimental. This latest support | |
8 | is independent and incompatible with previous implementation changes. | |
9 | ||
10 | You will need to perform three steps: | |
11 | ||
12 | =over | |
13 | ||
14 | =item 1. | |
15 | ||
16 | change the database character set to utf-8 | |
17 | ||
18 | =item 2. | |
19 | ||
20 | change the BSE character set to utf-8 | |
21 | ||
22 | =item 3. | |
23 | ||
24 | enable the utf8 flag. | |
25 | ||
26 | =back | |
27 | ||
28 | =head2 Changing the database character set | |
29 | ||
30 | For a new system you can simply do: | |
31 | ||
32 | cd util | |
33 | perl upgrade_mysql.pl -c utf8 | |
34 | ||
35 | For an old system it will be more complex. | |
36 | ||
37 | If the character set the database uses for your tables matches the | |
38 | character set of the data you already have stored, then the above will | |
39 | work. | |
40 | ||
41 | To check the character set: | |
42 | ||
43 | mysql -uuser -p databasename | |
44 | mysql> show full columns from order_item; | |
45 | ||
46 | If the C<Collation> column is a collation for your character set the | |
47 | the above will work. | |
48 | ||
49 | Note that Mysql's C<latin1> is equivalent to C<windows-1252>. | |
50 | ||
51 | If your database character set isn't equivalent you can fix the table | |
52 | character sets by converting to binary and then to the correct | |
53 | character set: | |
54 | ||
55 | perl upgrade_mysql.pl -c binary | |
56 | perl upgrade_mysql.pl -c latin1 | |
57 | ||
58 | Only then perform the conversion to C<utf8>. | |
59 | ||
60 | =head2 Changing the BSE character set to UTF-8 | |
61 | ||
62 | As you did historically, set C<charset> in C<html>: | |
63 | ||
64 | [html] | |
65 | charset=utf-8 | |
66 | ||
67 | =head2 Enable the C<utf8> flag | |
68 | ||
69 | Set C<utf8=1> in C<[basic]>: | |
70 | ||
71 | [basic] | |
72 | utf8=1 | |
73 | ||
74 | Note that this flag doesn't require that the BSE character set be set | |
75 | to utf-8, but it is recommended. | |
76 | ||
77 | The flag currently causes the following changes in behaviour: | |
78 | ||
79 | =over | |
80 | ||
81 | =item * | |
82 | ||
83 | template files are converted from the BSE character set to unicode for | |
84 | internal processing. | |
85 | ||
86 | =item * | |
87 | ||
88 | if the BSE character set is utf-8 then the database handle is | |
89 | configured to work in unicode. | |
90 | ||
91 | =item * | |
92 | ||
93 | template processed output is converted from unicode to the BSE | |
94 | character set on output. | |
95 | ||
96 | =item * | |
97 | ||
98 | JSON output is explicitly converted to UTF-8. | |
99 | ||
100 | =back | |
101 | ||
102 | BSE character set refers to the value configured in [html].charset | |
103 | ||
104 | =cut |