Skip to content

Instantly share code, notes, and snippets.

@ah01
Created April 29, 2012 23:01
Show Gist options
  • Select an option

  • Save ah01/2553754 to your computer and use it in GitHub Desktop.

Select an option

Save ah01/2553754 to your computer and use it in GitHub Desktop.
FireLogger UTF-8 test
<?php // this file is in utf-8
$json = '{"logs":[{"level":"debug","timestamp":1335428158.523,"message":"Žluťoučký kůň úpěl ďábelské ódy"}]}';
$res = str_split(base64_encode($json), 76);
foreach($res as $k=>$v) {
header("FireLogger-12345678-$k:$v");
}
// try content in different charset
header("Content-Type: text/plain;charset=cp1250");
echo iconv("utf-8", "cp1250", "Žluťoučký kůň úpěl ďábelské ódy");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment