Revision dbda14c2
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
SL/Common.pm | ||
---|---|---|
17 | 17 |
|
18 | 18 |
use SL::DBUtils; |
19 | 19 |
|
20 |
use vars qw(@db_encodings %db_encoding_to_charset %charset_to_db_encoding); |
|
21 |
|
|
22 |
@db_encodings = ( |
|
23 |
{ "label" => "ASCII", "dbencoding" => "SQL_ASCII", "charset" => "ASCII" }, |
|
24 |
{ "label" => "UTF-8 Unicode", "dbencoding" => "UNICODE", "charset" => "UTF-8" }, |
|
25 |
{ "label" => "ISO 8859-1", "dbencoding" => "LATIN1", "charset" => "ISO-8859-1" }, |
|
26 |
{ "label" => "ISO 8859-2", "dbencoding" => "LATIN2", "charset" => "ISO-8859-2" }, |
|
27 |
{ "label" => "ISO 8859-3", "dbencoding" => "LATIN3", "charset" => "ISO-8859-3" }, |
|
28 |
{ "label" => "ISO 8859-4", "dbencoding" => "LATIN4", "charset" => "ISO-8859-4" }, |
|
29 |
{ "label" => "ISO 8859-5", "dbencoding" => "LATIN5", "charset" => "ISO-8859-5" }, |
|
30 |
{ "label" => "ISO 8859-15", "dbencoding" => "LATIN9", "charset" => "ISO-8859-15" }, |
|
31 |
{ "label" => "KOI8-R", "dbencoding" => "KOI8", "charset" => "KOI8-R" }, |
|
32 |
{ "label" => "Windows CP1251", "dbencoding" => "WIN", "charset" => "CP1251" }, |
|
33 |
{ "label" => "Windows CP866", "dbencoding" => "ALT", "charset" => "CP866" }, |
|
34 |
); |
|
35 |
|
|
36 |
%db_encoding_to_charset = map { $_->{dbencoding}, $_->{charset} } @db_encodings; |
|
37 |
%charset_to_db_encoding = map { $_->{charset}, $_->{dbencoding} } @db_encodings; |
|
38 |
|
|
39 |
use constant DEFAULT_CHARSET => 'ISO-8859-15'; |
|
40 |
|
|
41 | 20 |
sub unique_id { |
42 | 21 |
my ($a, $b) = gettimeofday(); |
43 | 22 |
return "${a}-${b}-${$}"; |
Auch abrufbar als: Unified diff
Unterstützung für andere Datenbankencodings als Unicode/UTF-8 entfernt