Skip to content

Instantly share code, notes, and snippets.

@mindplay-dk
Last active August 10, 2016 12:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mindplay-dk/9b2fa55ba5f08ab0b9308295f936cd41 to your computer and use it in GitHub Desktop.
Save mindplay-dk/9b2fa55ba5f08ab0b9308295f936cd41 to your computer and use it in GitHub Desktop.
Problem with iconv() and the TRANSLIT option
<?php
$string = 'æøå'; // HEX: c3 a6 c3 b8 c3 a5
$clean = iconv('UTF-8', 'ASCII//TRANSLIT', $string);
var_dump($clean); // "aeoa" on Windows, "ae?a" on Linux???
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment