Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezmysqlcharset.php
Go to the documentation of this file.
1 <?php
12 abstract class eZMySQLCharset
13 {
18 protected static $mapping = array(
19 'iso-8859-1' => 'latin1',
20 'iso-8859-2' => 'latin2',
21 'iso-8859-8' => 'hebrew',
22 'iso-8859-7' => 'greek',
23 'iso-8859-9' => 'latin5',
24 'iso-8859-13' => 'latin7',
25 'windows-1250' => 'cp1250',
26 'windows-1251' => 'cp1251',
27 'windows-1256' => 'cp1256',
28 'windows-1257' => 'cp1257',
29 'utf-8' => 'utf8',
30 'koi8-r' => 'koi8r',
31 'koi8-u' => 'koi8u'
32 );
33
38 protected static $reverseMapping = array(
39 'latin1' => 'iso-8859-1',
40 'latin2' => 'iso-8859-2',
41 'hebrew' => 'iso-8859-8',
42 'greek' => 'iso-8859-7',
43 'latin5' => 'iso-8859-9',
44 'latin7' => 'iso-8859-13',
45 'cp1250' => 'windows-1250',
46 'cp1251' => 'windows-1251',
47 'cp1256' => 'windows-1256',
48 'cp1257' => 'windows-1257',
49 'utf8' => 'utf-8',
50 'koi8r' => 'koi8-r',
51 'koi8u' => 'koi8-u'
52 );
53
64 public static function mapTo( $charset )
65 {
66 $lowerCharset = strtolower( $charset );
67 return isset( self::$mapping[$lowerCharset] ) ? self::$mapping[$lowerCharset] : $charset;
68 }
69
80 public static function mapFrom( $charset )
81 {
82 $lowerCharset = strtolower( $charset );
83 return isset( self::$reverseMapping[$lowerCharset] ) ? self::$reverseMapping[$lowerCharset] : $charset;
84 }
85 }
86 ?>
eZMySQLCharset
Definition: ezmysqlcharset.php:13
eZMySQLCharset\$reverseMapping
static $reverseMapping
Definition: ezmysqlcharset.php:38
eZMySQLCharset\mapFrom
static mapFrom( $charset)
Definition: ezmysqlcharset.php:80
eZMySQLCharset\mapTo
static mapTo( $charset)
Definition: ezmysqlcharset.php:64
eZMySQLCharset\$mapping
static $mapping
Definition: ezmysqlcharset.php:18
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.