Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

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

Handles conversion from one charset to another. More...

Inheritance diagram for eZTextCodec:

## Public Member Functions
| __construct ( $inputCharsetCode, $outputCharsetCode, $realInputCharsetCode, $realOutputCharsetCode, $inputEncoding, $outputEncoding)
| initializeConversionFunction ( $encodingConvertInitMap, $encodingConvertInitFunction)
| initializeCodepageMapper ()
| initializeInputCodepage ()
| initializeOutputCodepage ()
| conversionRequired ()
| setUseMBString ( $use)
| useMBString ()
| requestedInputCharsetCode ()
| requestedOutputCharsetCode ()
| inputCharsetCode ()
| outputCharsetCode ()
| convertString ( $str)
| strlen ( $str)
| convertNoneToUnicode ( $str)
| convertCodepageToUnicode ( $str)
| convertUTF8ToUnicode ( $str)
| convertUnicodeToCodepage ( $unicodeValues)
| convertUnicodeToUTF8 ( $unicodeValues)
| convertNone ( $str)
| convertCodepage ( $str)
| convertCodepageRev ( $str)
| convertCodepageMapper ( $str)
| convertMBString ( $str)
| strlenNone ( $str)
| strlenUnicode ( $unicodeValues)
| strlenCodepage ( $str)
| strlenUTF8 ( $str)
| strlenCodepageRev ( $str)
| strlenCodepageMapper ( $str)
| strlenMBString ( $str)

## Static Public Member Functions
static | instance ( $inputCharsetCode, $outputCharsetCode=false, $alwaysReturn=true)
static | updateSettings ( $settings)
static | internalCharset ()
static | httpCharset ()

## Public Attributes
| $CodepageMapper
| $Codepage
| $RequestedInputCharsetCode
| $RequestedOutputCharsetCode
| $InputCharsetCode
| $OutputCharsetCode
| $InputCharacterEncodingScheme
| $OutputCharacterEncodingScheme
| $ConversionFunction
| $StrlenFunction
| $RequireConversion

## Detailed Description

Handles conversion from one charset to another.

Supports utf8 encoding/decoding

Definition at line 22 of file eztextcodec.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZTextCodec::__construct | ( |  | $inputCharsetCode,
|  |  | $outputCharsetCode,
|  |  | $realInputCharsetCode,
|  |  | $realOutputCharsetCode,
|  |  | $inputEncoding,
|  |  | $outputEncoding
| ) |  |

Parameters

  string | $inputCharsetCode |
  string | $outputCharsetCode |
  string | $realInputCharsetCode |
  string | $realOutputCharsetCode |
  string | $inputEncoding |
  string | $outputEncoding |

Definition at line 34 of file eztextcodec.php.

References $InputCharacterEncodingScheme, $OutputCharacterEncodingScheme, initializeConversionFunction(), useMBString(), and eZDebug\writeError().

## Member Function Documentation

## ◆ conversionRequired()

eZTextCodec::conversionRequired | ( |  | ) |

/

Returns
  true if a conversion is required, if false there's no need to call the textcodec functions.

Definition at line 263 of file eztextcodec.php.

References $RequireConversion.

## ◆ convertCodepage()

eZTextCodec::convertCodepage | ( |  | $str | ) |

Definition at line 362 of file eztextcodec.php.

References eZDebug\accumulatorStart(), and eZDebug\accumulatorStop().

## ◆ convertCodepageMapper()

eZTextCodec::convertCodepageMapper | ( |  | $str | ) |

Definition at line 378 of file eztextcodec.php.

References eZDebug\accumulatorStart(), and eZDebug\accumulatorStop().

## ◆ convertCodepageRev()

eZTextCodec::convertCodepageRev | ( |  | $str | ) |

Definition at line 370 of file eztextcodec.php.

References eZDebug\accumulatorStart(), and eZDebug\accumulatorStop().

## ◆ convertCodepageToUnicode()

eZTextCodec::convertCodepageToUnicode | ( |  | $str | ) |

Definition at line 325 of file eztextcodec.php.

References eZDebug\accumulatorStart(), and eZDebug\accumulatorStop().

## ◆ convertMBString()

eZTextCodec::convertMBString | ( |  | $str | ) |

Definition at line 386 of file eztextcodec.php.

References eZDebug\accumulatorStart(), and eZDebug\accumulatorStop().

## ◆ convertNone()

eZTextCodec::convertNone | ( |  | $str | ) |

Definition at line 357 of file eztextcodec.php.

## ◆ convertNoneToUnicode()

eZTextCodec::convertNoneToUnicode | ( |  | $str | ) |

Returns
  an empty array since no conversion is possible.

Definition at line 320 of file eztextcodec.php.

## ◆ convertString()

eZTextCodec::convertString | ( |  | $str | ) |

Definition at line 301 of file eztextcodec.php.

References $ConversionFunction, eZDebug\accumulatorStart(), and eZDebug\accumulatorStop().

## ◆ convertUnicodeToCodepage()

eZTextCodec::convertUnicodeToCodepage | ( |  | $unicodeValues | ) |

Definition at line 341 of file eztextcodec.php.

References eZDebug\accumulatorStart(), and eZDebug\accumulatorStop().

## ◆ convertUnicodeToUTF8()

eZTextCodec::convertUnicodeToUTF8 | ( |  | $unicodeValues | ) |

Definition at line 349 of file eztextcodec.php.

References eZDebug\accumulatorStart(), eZDebug\accumulatorStop(), and eZUTF8Codec\convertUnicodeToString().

## ◆ convertUTF8ToUnicode()

eZTextCodec::convertUTF8ToUnicode | ( |  | $str | ) |

Definition at line 333 of file eztextcodec.php.

References eZDebug\accumulatorStart(), eZDebug\accumulatorStop(), and eZUTF8Codec\convertStringToUnicode().

## ◆ httpCharset()

static eZTextCodec::httpCharset | ( |  | ) |
| static

Returns
  a charset value which can be used in HTTP headers.

Note
  Will return the internalCharset() if not http charset is set.

Definition at line 568 of file eztextcodec.php.

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

## ◆ initializeCodepageMapper()

eZTextCodec::initializeCodepageMapper | ( |  | ) |

Definition at line 244 of file eztextcodec.php.

References eZCodePageMapper\instance().

## ◆ initializeConversionFunction()

eZTextCodec::initializeConversionFunction | ( |  | $encodingConvertInitMap,
|  |  | $encodingConvertInitFunction
| ) |  |

Definition at line 222 of file eztextcodec.php.

References $InputCharacterEncodingScheme, and $OutputCharacterEncodingScheme.

Referenced by __construct().

## ◆ initializeInputCodepage()

eZTextCodec::initializeInputCodepage | ( |  | ) |

Definition at line 250 of file eztextcodec.php.

References eZCodePage\instance().

## ◆ initializeOutputCodepage()

eZTextCodec::initializeOutputCodepage | ( |  | ) |

Definition at line 255 of file eztextcodec.php.

References eZCodePage\instance().

## ◆ inputCharsetCode()

eZTextCodec::inputCharsetCode | ( |  | ) |

Definition at line 291 of file eztextcodec.php.

References $InputCharsetCode.

## ◆ instance()

static eZTextCodec::instance | ( |  | $inputCharsetCode,
|  |  | $outputCharsetCode = `false`,
|  |  | $alwaysReturn = `true`
| ) |  |
| static

Returns a shared instance of the eZTextCodec pr the $inputCharsetCode and $outputCharsetCode params.

Parameters

  string | false | $inputCharsetCode | Uses eZTextCodec::internalCharset() if false
  string | false | $outputCharsetCode | Uses eZTextCodec::internalCharset() if false
  bool | $alwaysReturn |

Returns
  eZTextCodec|null Returns null if $alwaysReturn is false and text codec is not needed for current $inputCharsetCode and $outputCharsetCode.

Definition at line 446 of file eztextcodec.php.

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

Referenced by eZDBInterface\__construct(), eZURI\convertFilterString(), eZMail\convertText(), eZURI\decodeIRI(), eZURI\encodeIRI(), eZMail\encodeMimeHeader(), eZCodeMapper\executeCommandCode(), eZAlphabetOperator\fetchAlphabet(), eZCodeMapper\generateCharsetMappingTable(), eZTSTranslator\handleMessageNode(), eZTemplateFileResource\handleResourceData(), eZPDF\modify(), eZTemplateStringOperator\modify(), eZCodeMapper\parseTransformationFile(), eZXMLTextType\rawXMLText(), and eZStringType\validateStringHTTPInput().

## ◆ internalCharset()

static eZTextCodec::internalCharset | ( |  | ) |
| static

Returns
  the charset which is used internally, this is the charset which all external files and resources are converted to.

Note
  will return iso-8859-1 if eZTextCodec has been updated with proper settings.

Examples
  /web/vh/ezpublish.se7enx.com/doc/api.exponential.earth/src/exponential/kernel/classes/ezurlaliasml.php.

Definition at line 546 of file eztextcodec.php.

References eZCharsetInfo\realCharsetCode().

Referenced by eZTemplateCompiler\compilationFilename(), eZMatrix\domString(), eZObjectRelationType\domString(), eZObjectRelationListType\domString(), eZCodeMapper\executeCommandCode(), httpCharset(), eZDB\instance(), instance(), eZTSTranslator\loadTranslationFile(), eZPDF\modify(), eZTemplateStringOperator\modify(), eZTranslationCache\rootCacheDirectory(), eZTranslationCache\storeCache(), eZURLAliasML\strtolower(), eZCharTransform\transform(), eZCharTransform\transformByGroup(), and eZTemplateTreeCache\treeCacheFilename().

## ◆ outputCharsetCode()

eZTextCodec::outputCharsetCode | ( |  | ) |

Definition at line 296 of file eztextcodec.php.

References $OutputCharsetCode.

## ◆ requestedInputCharsetCode()

eZTextCodec::requestedInputCharsetCode | ( |  | ) |

Definition at line 281 of file eztextcodec.php.

References $RequestedInputCharsetCode.

## ◆ requestedOutputCharsetCode()

eZTextCodec::requestedOutputCharsetCode | ( |  | ) |

Definition at line 286 of file eztextcodec.php.

References $RequestedOutputCharsetCode.

## ◆ setUseMBString()

eZTextCodec::setUseMBString | ( |  | $use | ) |

Definition at line 268 of file eztextcodec.php.

## ◆ strlen()

eZTextCodec::strlen | ( |  | $str | ) |

Definition at line 311 of file eztextcodec.php.

References $StrlenFunction.

Referenced by eZCodePageCodec\fromUnicode(), strlenNone(), and eZCodePageCodec\toUnicode().

## ◆ strlenCodepage()

eZTextCodec::strlenCodepage | ( |  | $str | ) |

Definition at line 407 of file eztextcodec.php.

## ◆ strlenCodepageMapper()

eZTextCodec::strlenCodepageMapper | ( |  | $str | ) |

Definition at line 423 of file eztextcodec.php.

## ◆ strlenCodepageRev()

eZTextCodec::strlenCodepageRev | ( |  | $str | ) |

Definition at line 418 of file eztextcodec.php.

## ◆ strlenMBString()

eZTextCodec::strlenMBString | ( |  | $str | ) |

Definition at line 428 of file eztextcodec.php.

## ◆ strlenNone()

eZTextCodec::strlenNone | ( |  | $str | ) |

Definition at line 397 of file eztextcodec.php.

References strlen().

## ◆ strlenUnicode()

eZTextCodec::strlenUnicode | ( |  | $unicodeValues | ) |

Definition at line 402 of file eztextcodec.php.

## ◆ strlenUTF8()

eZTextCodec::strlenUTF8 | ( |  | $str | ) |

Definition at line 412 of file eztextcodec.php.

References eZUTF8Codec\instance().

## ◆ updateSettings()

static eZTextCodec::updateSettings | ( |  | $settings | ) |
| static

Initializes the eZTextCodec settings to the ones in the array $settings.

See also
  internalCharset, httpCharset.

Definition at line 526 of file eztextcodec.php.

Referenced by eZScript\updateTextCodecSettings().

## ◆ useMBString()

eZTextCodec::useMBString | ( |  | ) |

Definition at line 273 of file eztextcodec.php.

Referenced by __construct().

## Member Data Documentation

## ◆ $Codepage

eZTextCodec::$Codepage

Definition at line 25 of file eztextcodec.php.

## ◆ $CodepageMapper

eZTextCodec::$CodepageMapper

Definition at line 24 of file eztextcodec.php.

## ◆ $ConversionFunction

eZTextCodec::$ConversionFunction

Definition at line 597 of file eztextcodec.php.

Referenced by convertString().

## ◆ $InputCharacterEncodingScheme

eZTextCodec::$InputCharacterEncodingScheme

Definition at line 595 of file eztextcodec.php.

Referenced by __construct(), and initializeConversionFunction().

## ◆ $InputCharsetCode

eZTextCodec::$InputCharsetCode

Definition at line 593 of file eztextcodec.php.

Referenced by inputCharsetCode().

## ◆ $OutputCharacterEncodingScheme

eZTextCodec::$OutputCharacterEncodingScheme

Definition at line 596 of file eztextcodec.php.

Referenced by __construct(), and initializeConversionFunction().

## ◆ $OutputCharsetCode

eZTextCodec::$OutputCharsetCode

Definition at line 594 of file eztextcodec.php.

Referenced by outputCharsetCode().

## ◆ $RequestedInputCharsetCode

eZTextCodec::$RequestedInputCharsetCode

Definition at line 591 of file eztextcodec.php.

Referenced by requestedInputCharsetCode().

## ◆ $RequestedOutputCharsetCode

eZTextCodec::$RequestedOutputCharsetCode

Definition at line 592 of file eztextcodec.php.

Referenced by requestedOutputCharsetCode().

## ◆ $RequireConversion

eZTextCodec::$RequireConversion

Definition at line 599 of file eztextcodec.php.

Referenced by conversionRequired().

## ◆ $StrlenFunction

eZTextCodec::$StrlenFunction

Definition at line 598 of file eztextcodec.php.

Referenced by strlen().

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

- eztextcodec.php

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