Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | Static Private Member Functions | List of all members
eZCodePage Class Reference
Internationalization

Handles codepage files for charset mapping. More...

## Public Member Functions
| __construct ( $charset_code, $use_cache=true)
| convertString ( $str)
| convertStringToUnicode ( $str)
| convertUnicodeToString ( $unicodeValues)
| convertStringFromUTF8 ( $multi_char)
| strlen ( $str)
| strlenFromUTF8 ( $str)
| charToUtf8 ( $str, $pos, &$charLen)
| charToUnicode ( $str, $pos, &$charLen)
| codeToUtf8 ( $code)
| codeToUnicode ( $code)
| utf8ToChar ( $ucode)
| unicodeToChar ( $ucode)
| utf8ToCode ( $ucode)
| unicodeToCode ( $ucode)
| substituteChar ()
| setSubstituteChar ( $char)
| cacheFileName ( $charset_code)
| fileModification ( $charset_code)
| codepageList ()
| storeCacheObject ( $filename, $permissionArray)
| cacheFilepath ()
| load ( $use_cache=true)
| charsetCode ()
| requestedCharsetCode ()
| minCharValue ()
| maxCharValue ()
| isValid ()

## Static Public Member Functions
static | exists ( $charset_code)
static | fileName ( $charset_code)
static | instance ( $charset_code, $use_cache=true)

## Public Attributes
| $ReadExtraMap
const | CACHE_CODE_DATE = 1028204478
| $RequestedCharsetCode
| $CharsetCode
| The read charset code, may differ from $RequestedCharsetCode. More...
| $CharsetEncodingScheme
| Encoding scheme for current charset, for instance utf-8, singlebyte, multibyte. More...
| $UnicodeMap
| Maps normal codes to unicode. More...
| $UTF8Map
| Maps normal codes to utf8. More...
| $CodeMap
| Maps unicode to normal codes. More...
| $UTF8CodeMap
| Maps utf8 to normal codes. More...
| $MinCharValue
| The minimum key value for the mapping tables. More...
| $MaxCharValue
| The maximum key value for the mapping tables. More...
| $Valid
| Whether the codepage is valid or not. More...
| $SubstituteChar
| The character to use when an alternative doesn't exist. More...

## Static Private Member Functions
static | permissionSetting ()
static | setPermissionSetting ( $permissionArray)
static | flushCacheObject ()

## Detailed Description

Handles codepage files for charset mapping.

Definition at line 18 of file ezcodepage.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZCodePage::__construct | ( |  | $charset_code,
|  |  | $use_cache = `true`
| ) |  |

Initializes the codepage with the charset code $charset_code, and then loads it.

Parameters

  string | $charset_code |
  bool | $use_cache |

Definition at line 29 of file ezcodepage.php.

References eZCharsetInfo\characterEncodingScheme(), load(), and eZCharsetInfo\realCharsetCode().

## Member Function Documentation

## ◆ cacheFileName()

eZCodePage::cacheFileName | ( |  | $charset_code | ) |

Definition at line 352 of file ezcodepage.php.

References permissionSetting(), and eZCharsetInfo\realCharsetCode().

## ◆ cacheFilepath()

eZCodePage::cacheFilepath | ( |  | ) |

Definition at line 486 of file ezcodepage.php.

References permissionSetting().

## ◆ charsetCode()

eZCodePage::charsetCode | ( |  | ) |

Returns
  the charset code which is in use. This may not be the charset that was requested due to aliases.

See also
  requestedCharsetCode

Definition at line 668 of file ezcodepage.php.

References $CharsetCode.

## ◆ charToUnicode()

eZCodePage::charToUnicode | ( |  | $str,
|  |  | $pos,
|  | & | $charLen
| ) |  |

Definition at line 251 of file ezcodepage.php.

Referenced by convertStringToUnicode().

## ◆ charToUtf8()

eZCodePage::charToUtf8 | ( |  | $str,
|  |  | $pos,
|  | & | $charLen
| ) |  |

Definition at line 237 of file ezcodepage.php.

## ◆ codepageList()

eZCodePage::codepageList | ( |  | ) |

Definition at line 373 of file ezcodepage.php.

## ◆ codeToUnicode()

eZCodePage::codeToUnicode | ( |  | $code | ) |

Definition at line 270 of file ezcodepage.php.

## ◆ codeToUtf8()

eZCodePage::codeToUtf8 | ( |  | $code | ) |

Definition at line 265 of file ezcodepage.php.

## ◆ convertString()

eZCodePage::convertString | ( |  | $str | ) |

Definition at line 42 of file ezcodepage.php.

References eZUTF8Codec\instance(), and strlen().

## ◆ convertStringFromUTF8()

eZCodePage::convertStringFromUTF8 | ( |  | $multi_char | ) |

Definition at line 88 of file ezcodepage.php.

References $CodeMap, $SubstituteChar, and strlen().

## ◆ convertStringToUnicode()

eZCodePage::convertStringToUnicode | ( |  | $str | ) |

Definition at line 60 of file ezcodepage.php.

References charToUnicode(), and strlen().

## ◆ convertUnicodeToString()

eZCodePage::convertUnicodeToString | ( |  | $unicodeValues | ) |

Definition at line 75 of file ezcodepage.php.

References unicodeToChar().

## ◆ exists()

static eZCodePage::exists | ( |  | $charset_code | ) |
| static

Returns true if the codepage $charset_code exists.

Definition at line 335 of file ezcodepage.php.

References fileName().

Referenced by eZCodePageMapper\load().

## ◆ fileModification()

eZCodePage::fileModification | ( |  | $charset_code | ) |

Definition at line 365 of file ezcodepage.php.

References fileName().

Referenced by eZCodePageMapper\load().

## ◆ fileName()

static eZCodePage::fileName | ( |  | $charset_code | ) |
| static

Returns the filename of the charset code $charset_code.

Definition at line 345 of file ezcodepage.php.

References eZCharsetInfo\realCharsetCode().

Referenced by exists(), fileModification(), and eZCodePageMapper\load().

## ◆ flushCacheObject()

static eZCodePage::flushCacheObject | ( |  | ) |
| static private

Definition at line 762 of file ezcodepage.php.

References permissionSetting().

Referenced by setPermissionSetting().

## ◆ instance()

static eZCodePage::instance | ( |  | $charset_code,
|  |  | $use_cache = `true`
| ) |  |
| static

Returns a shared instance of the eZCodePage pr the $charset_code param.

Parameters

  string | $charset_code |
  bool | $use_cache |

Returns
  eZCodePage

Definition at line 713 of file ezcodepage.php.

Referenced by eZTextCodec\initializeInputCodepage(), eZTextCodec\initializeOutputCodepage(), eZCodePageMapper\load(), and eZCodePageMapper\setSubstituteCharacter().

## ◆ isValid()

eZCodePage::isValid | ( |  | ) |

Returns true if the codepage is valid for use.

Definition at line 700 of file ezcodepage.php.

References $Valid.

## ◆ load()

eZCodePage::load | ( |  | $use_cache = `true` | ) |

Loads the codepage from disk. If $use_cache is true and a cached version is found it is used instead. If $use_cache is true and no cache was found a new cache is created.

Definition at line 506 of file ezcodepage.php.

References $CharsetCode, eZUTF8Codec\instance(), permissionSetting(), storeCacheObject(), and eZDebug\writeWarning().

Referenced by __construct().

## ◆ maxCharValue()

eZCodePage::maxCharValue | ( |  | ) |

Returns
  the largest character value used in the mapping table.

Definition at line 692 of file ezcodepage.php.

References $MaxCharValue.

## ◆ minCharValue()

eZCodePage::minCharValue | ( |  | ) |

Returns
  the lowest character value used in the mapping table.

Definition at line 684 of file ezcodepage.php.

References $MinCharValue.

## ◆ permissionSetting()

static eZCodePage::permissionSetting | ( |  | ) |
| static private

Gets the permission setting for codepage files & returns it. If the permission setting doesnt exists: returns false.

Definition at line 728 of file ezcodepage.php.

Referenced by cacheFileName(), cacheFilepath(), flushCacheObject(), and load().

## ◆ requestedCharsetCode()

eZCodePage::requestedCharsetCode | ( |  | ) |

Returns
  the charset code which was requested, may differ from charsetCode()

Definition at line 676 of file ezcodepage.php.

References $RequestedCharsetCode.

## ◆ setPermissionSetting()

static eZCodePage::setPermissionSetting | ( |  | $permissionArray | ) |
| static private

Sets the permission setting for codepagefiles.

Definition at line 747 of file ezcodepage.php.

References flushCacheObject().

Referenced by eZScript\initialize().

## ◆ setSubstituteChar()

eZCodePage::setSubstituteChar | ( |  | $char | ) |

Definition at line 326 of file ezcodepage.php.

## ◆ storeCacheObject()

eZCodePage::storeCacheObject | ( |  | $filename,
|  |  | $permissionArray
| ) |  |

Stores the cache object.

Definition at line 396 of file ezcodepage.php.

Referenced by load().

## ◆ strlen()

eZCodePage::strlen | ( |  | $str | ) |

Definition at line 211 of file ezcodepage.php.

Referenced by convertString(), convertStringFromUTF8(), and convertStringToUnicode().

## ◆ strlenFromUTF8()

eZCodePage::strlenFromUTF8 | ( |  | $str | ) |

Definition at line 232 of file ezcodepage.php.

References eZUTF8Codec\instance().

## ◆ substituteChar()

eZCodePage::substituteChar | ( |  | ) |

Definition at line 321 of file ezcodepage.php.

References $SubstituteChar.

## ◆ unicodeToChar()

eZCodePage::unicodeToChar | ( |  | $ucode | ) |

Definition at line 293 of file ezcodepage.php.

Referenced by convertUnicodeToString().

## ◆ unicodeToCode()

eZCodePage::unicodeToCode | ( |  | $ucode | ) |

Definition at line 314 of file ezcodepage.php.

## ◆ utf8ToChar()

eZCodePage::utf8ToChar | ( |  | $ucode | ) |

Definition at line 279 of file ezcodepage.php.

## ◆ utf8ToCode()

eZCodePage::utf8ToCode | ( |  | $ucode | ) |

Definition at line 307 of file ezcodepage.php.

## Member Data Documentation

## ◆ $CharsetCode

eZCodePage::$CharsetCode

The read charset code, may differ from $RequestedCharsetCode.

Definition at line 806 of file ezcodepage.php.

Referenced by charsetCode(), and load().

## ◆ $CharsetEncodingScheme

eZCodePage::$CharsetEncodingScheme

Encoding scheme for current charset, for instance utf-8, singlebyte, multibyte.

Definition at line 808 of file ezcodepage.php.

## ◆ $CodeMap

eZCodePage::$CodeMap

Maps unicode to normal codes.

Definition at line 814 of file ezcodepage.php.

Referenced by convertStringFromUTF8().

## ◆ $MaxCharValue

eZCodePage::$MaxCharValue

The maximum key value for the mapping tables.

Definition at line 820 of file ezcodepage.php.

Referenced by maxCharValue().

## ◆ $MinCharValue

eZCodePage::$MinCharValue

The minimum key value for the mapping tables.

Definition at line 818 of file ezcodepage.php.

Referenced by minCharValue().

## ◆ $ReadExtraMap

eZCodePage::$ReadExtraMap

Definition at line 20 of file ezcodepage.php.

## ◆ $RequestedCharsetCode

eZCodePage::$RequestedCharsetCode

The charset code which was requested, may differ from $CharsetCode

Definition at line 804 of file ezcodepage.php.

Referenced by requestedCharsetCode().

## ◆ $SubstituteChar

eZCodePage::$SubstituteChar

The character to use when an alternative doesn't exist.

Definition at line 824 of file ezcodepage.php.

Referenced by convertStringFromUTF8(), and substituteChar().

## ◆ $UnicodeMap

eZCodePage::$UnicodeMap

Maps normal codes to unicode.

Definition at line 810 of file ezcodepage.php.

## ◆ $UTF8CodeMap

eZCodePage::$UTF8CodeMap

Maps utf8 to normal codes.

Definition at line 816 of file ezcodepage.php.

## ◆ $UTF8Map

eZCodePage::$UTF8Map

Maps normal codes to utf8.

Definition at line 812 of file ezcodepage.php.

## ◆ $Valid

eZCodePage::$Valid

Whether the codepage is valid or not.

Definition at line 822 of file ezcodepage.php.

Referenced by isValid().

## ◆ CACHE_CODE_DATE

const eZCodePage::CACHE_CODE_DATE = 1028204478

Definition at line 21 of file ezcodepage.php.

The documentation for this class was generated from the following file:

- ezcodepage.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.