Exponential Basic 2.4.0.1 Exponential Basic 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 19 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 30 of file ezcodepage.php.

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

## Member Function Documentation

## ◆ cacheFileName()

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

Definition at line 353 of file ezcodepage.php.

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

## ◆ cacheFilepath()

eZCodePage::cacheFilepath | ( |  | ) |

Definition at line 487 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 669 of file ezcodepage.php.

References $CharsetCode.

## ◆ charToUnicode()

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

Definition at line 252 of file ezcodepage.php.

References $str.

Referenced by convertStringToUnicode().

## ◆ charToUtf8()

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

Definition at line 238 of file ezcodepage.php.

References $str.

## ◆ codepageList()

eZCodePage::codepageList | ( |  | ) |

Definition at line 374 of file ezcodepage.php.

References $dir, and $file.

## ◆ codeToUnicode()

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

Definition at line 271 of file ezcodepage.php.

## ◆ codeToUtf8()

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

Definition at line 266 of file ezcodepage.php.

## ◆ convertString()

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

Definition at line 43 of file ezcodepage.php.

References $i, $str, eZUTF8Codec\instance(), and strlen().

## ◆ convertStringFromUTF8()

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

Definition at line 89 of file ezcodepage.php.

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

## ◆ convertStringToUnicode()

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

Definition at line 61 of file ezcodepage.php.

References $i, $str, charToUnicode(), and strlen().

## ◆ convertUnicodeToString()

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

Definition at line 76 of file ezcodepage.php.

References unicodeToChar().

## ◆ exists()

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

Returns true if the codepage $charset_code exists.

Definition at line 336 of file ezcodepage.php.

References $file, file_exists(), and fileName().

Referenced by eZCodePageMapper\load().

## ◆ fileModification()

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

Definition at line 366 of file ezcodepage.php.

References $file, file_exists(), and fileName().

Referenced by eZCodePageMapper\load().

## ◆ fileName()

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

Returns the filename of the charset code $charset_code.

Definition at line 346 of file ezcodepage.php.

References $file, and eZCharsetInfo\realCharsetCode().

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

## ◆ flushCacheObject()

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

Definition at line 763 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 714 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 701 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 507 of file ezcodepage.php.

References $args, $CharsetCode, $desc, $file, $i, $items, $lines, file_exists(), 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 693 of file ezcodepage.php.

References $MaxCharValue.

## ◆ minCharValue()

eZCodePage::minCharValue | ( |  | ) |

Returns
  the lowest character value used in the mapping table.

Definition at line 685 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 729 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 677 of file ezcodepage.php.

References $RequestedCharsetCode.

## ◆ setPermissionSetting()

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

Sets the permission setting for codepagefiles.

Definition at line 748 of file ezcodepage.php.

References flushCacheObject().

## ◆ setSubstituteChar()

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

Definition at line 327 of file ezcodepage.php.

## ◆ storeCacheObject()

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

Stores the cache object.

Definition at line 397 of file ezcodepage.php.

References $dir, $file, $item, and file_exists().

Referenced by load().

## ◆ strlen()

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

Definition at line 212 of file ezcodepage.php.

References $i, and $str.

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

## ◆ strlenFromUTF8()

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

Definition at line 233 of file ezcodepage.php.

References $str, and eZUTF8Codec\instance().

## ◆ substituteChar()

eZCodePage::substituteChar | ( |  | ) |

Definition at line 322 of file ezcodepage.php.

References $SubstituteChar.

## ◆ unicodeToChar()

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

Definition at line 294 of file ezcodepage.php.

Referenced by convertUnicodeToString().

## ◆ unicodeToCode()

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

Definition at line 315 of file ezcodepage.php.

## ◆ utf8ToChar()

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

Definition at line 280 of file ezcodepage.php.

## ◆ utf8ToCode()

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

Definition at line 308 of file ezcodepage.php.

## Member Data Documentation

## ◆ $CharsetCode

eZCodePage::$CharsetCode

The read charset code, may differ from $RequestedCharsetCode.

Definition at line 807 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 809 of file ezcodepage.php.

## ◆ $CodeMap

eZCodePage::$CodeMap

Maps unicode to normal codes.

Definition at line 815 of file ezcodepage.php.

Referenced by convertStringFromUTF8().

## ◆ $MaxCharValue

eZCodePage::$MaxCharValue

The maximum key value for the mapping tables.

Definition at line 821 of file ezcodepage.php.

Referenced by maxCharValue().

## ◆ $MinCharValue

eZCodePage::$MinCharValue

The minimum key value for the mapping tables.

Definition at line 819 of file ezcodepage.php.

Referenced by minCharValue().

## ◆ $ReadExtraMap

eZCodePage::$ReadExtraMap

Definition at line 21 of file ezcodepage.php.

## ◆ $RequestedCharsetCode

eZCodePage::$RequestedCharsetCode

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

Definition at line 805 of file ezcodepage.php.

Referenced by requestedCharsetCode().

## ◆ $SubstituteChar

eZCodePage::$SubstituteChar

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

Definition at line 825 of file ezcodepage.php.

Referenced by convertStringFromUTF8(), and substituteChar().

## ◆ $UnicodeMap

eZCodePage::$UnicodeMap

Maps normal codes to unicode.

Definition at line 811 of file ezcodepage.php.

## ◆ $UTF8CodeMap

eZCodePage::$UTF8CodeMap

Maps utf8 to normal codes.

Definition at line 817 of file ezcodepage.php.

## ◆ $UTF8Map

eZCodePage::$UTF8Map

Maps normal codes to utf8.

Definition at line 813 of file ezcodepage.php.

## ◆ $Valid

eZCodePage::$Valid

Whether the codepage is valid or not.

Definition at line 823 of file ezcodepage.php.

Referenced by isValid().

## ◆ CACHE_CODE_DATE

const eZCodePage::CACHE_CODE_DATE = 1028204478

Definition at line 22 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+.