All pastes #18723 Raw Edit

Unnamed

public text v1 · immutable
#18723 ·published 2005-07-28 17:59 UTC
rendered paste body
    // do character encoding translations.
    $charsets = array('latin1', 'windows-1251', 'windows-1252');
    $converts = array('headline', 'synopsis', 'transcript', 'tease');
    foreach ($converts as $convert) { // make sure they're not already.
      foreach ($charsets as $charset) {
        if ($converted = iconv($charset, 'utf-8', $pg_row[$convert])) {
          $pg_row[$convert] = $converted; // yummy utf-8. yay!
        }
      }
    }