Re: Help needed with mb_convert_encoding()

From: Date: Wed, 28 May 2014 12:12:32 +0000
Subject: Re: Help needed with mb_convert_encoding()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-323368@lists.php.net to get a copy of this message
Alain Williams wrote: > I am trying to use this to validate input that is supposed to be UTF-8 and to > replace any bad characters with something - '?' would do. > > I have the test program below. No matter what I try to give as an argument to > mb_substitute_character() it always removes the bad input sequence, I would like > to replace it. Have you considered using htmlspecialchars($input, ENT_SUBSTITUTE, 'UTF-8') instead of mb_substitute_character()? -- Christoph M. Becker

« previous php.general (#323368) next »