Skip to content

Instantly share code, notes, and snippets.

@tallesairan
Last active June 14, 2018 14:33
Show Gist options
  • Save tallesairan/2640b695b2fe03590038af91ae45c46d to your computer and use it in GitHub Desktop.
Save tallesairan/2640b695b2fe03590038af91ae45c46d to your computer and use it in GitHub Desktop.
Detect encoding of string using Multibyte snippet created to test Oracle strings #oracle
$text = "A strånge string to pass, maybe with søme ø, æ, å characters.";
foreach(mb_list_encodings() as $charset){
echo mb_convert_encoding($text, 'UTF-8', $charset)." : ".$charset."<br>";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment