PHP unicode_encode function
Like this blog? Consider exploring one of our sponsored banner ads...
unicode_encode
(PHP 5 CVS only)
unicode_encode — Set encoding of a unicode stringDescriptionstring unicode_encode ( unicode input, string encoding, int flags )Warning
This function is
currently not documented; only the argument list is
available.
Takes a unicode string and converts it to a string in
the specified encoding.
input
The unicode string that will be encoded.
The new encoding for input.
Flags
Return Values
A string on success, or FALSE on failure.
Emits a E_WARNING level error if a converter cannot
be created for the desired encoding.
Example 1. A unicode_encode() example
Note: The characters will be seen instead of entities in the output.
header ('Content-Type: text/plain; charset=ISO-8859-2'); $encoded = unicode_encode ('\u0150\u0179', 'ISO-8859-2'); echo 'Unicode semantics: ', ini_get ('unicode_semantics'), PHP_EOL; echo 'The string itself:', $encoded, PHP_EOL; echo 'The length of the string: ', strlen ($encoded);
The above example will output
something similar to:
The string itself: ŐŹ
The length of the string: 2
See Also
unicode_symantics()
About this entry
You’re currently reading “PHP unicode_encode function,” an entry on BRADINO
- Published:
- 2.26.07 / 12am
- Category:
- PHP Functions
- Tags:
No comments
Jump to comment form | comments rss [?] | trackback uri [?]