PYTHON unicode_set_subst_char

Python replacement for PHP's unicode_set_subst_char [ edit ]

Do you know a Python replacement for PHP's unicode_set_subst_char ? Write it!

PHP unicode_set_subst_char

PHP original manual for unicode_set_subst_char [ show | ]


(PHP 6 >= 6.0.0)

unicode_set_subst_charSet the substitution character for string conversion errors


bool unicode_set_subst_char ( unicode $character )

When converting a string from or to unicode, an invalid or unconvertible character may be encountered. When the conversion error mode is set to U_CONV_ERROR_SUBST, the character that caused the error is substituted by a character set by this function. The default substitution character is ?.



The substitution character to use.

Return Values

Returns TRUE on success or FALSE on failure.


Emits a E_WARNING level error if character is invalid.



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