PHP » PYTHON |
login |
register |
about
|
PYTHON unicode_encode
is this article helpful?
|
Python replacement for PHP's unicode_encode
[
edit
| history
]
Python 2.x:
u'\u0150\u0179'.encode('iso-8859-2') Python 3.x: '\u0150\u0179'.encode('iso-8859-2') unicode_encode(PHP 6 >= 6.0.0) unicode_encode — Convert a unicode string in any encoding Description
string unicode_encode
( unicode $input
, string $encoding
[, int $errmode
] )
Takes a unicode string and converts it to a string in the specified encoding . Parameters
Return ValuesA string on success, or FALSE on failure. Errors/ExceptionsEmits a E_WARNING level error if a converter cannot be created for the desired encoding . Examples
Example #1 A unicode_encode() example Note: The characters will be seen instead of entities in the output.
<?php The above example will output something similar to: Unicode semantics: 1 The string itself: ŐŹ The length of the string: 2
NotesWarning
This function is EXPERIMENTAL. The behaviour of this function, its name, and surrounding documentation may change without notice in a future release of PHP. This function should be used at your own risk. See Also
|
more
Recently updated
more
Most requested
more
Last requests
|