|
@@ 86-92 (lines=7) @@
|
| 83 |
|
* @return self |
| 84 |
|
* @throws InvalidArgumentException |
| 85 |
|
*/ |
| 86 |
|
public static function fromEncodedCharacter($character, TransformationFormat $encoding) |
| 87 |
|
{ |
| 88 |
|
$convertTo = TransformationFormat::ofType(TransformationFormat::THIRTY_TWO_BIG_ENDIAN); |
| 89 |
|
$converted = TransformationFormat\StringUtility::convertCharacter($character, $encoding, $convertTo); |
| 90 |
|
|
| 91 |
|
return self::fromUTF32($converted); |
| 92 |
|
} |
| 93 |
|
|
| 94 |
|
/** |
| 95 |
|
* @param string $value |
|
@@ 137-143 (lines=7) @@
|
| 134 |
|
* @return string |
| 135 |
|
* @throws InvalidArgumentException |
| 136 |
|
*/ |
| 137 |
|
public function toEncodedCharacter(TransformationFormat $encoding) |
| 138 |
|
{ |
| 139 |
|
$character = $this->toUTF32(); |
| 140 |
|
$convertFrom = TransformationFormat::ofType(TransformationFormat::THIRTY_TWO); |
| 141 |
|
|
| 142 |
|
return TransformationFormat\StringUtility::convertCharacter($character, $convertFrom, $encoding); |
| 143 |
|
} |
| 144 |
|
|
| 145 |
|
/** |
| 146 |
|
* @return string |