<?php /** * Automatically transform output charset * ====================================== * * I18Nv2 provides an easy way to utilize the ob_iconv_handler() through * I18Nv2::autoConv($output_charset, $input_charset). * * $Id: transform_output_charset.php,v 1.1 2004/05/03 15:02:17 mike Exp $ */ require_once 'I18Nv2.php'; // Writing a shell app that should also display nicely in a DOS box if (I18Nv2_WIN) { I18Nv2::autoConv('CP850'); } // output some latin1 stuff echo "δόφί\n";
/** * This method utilizes ob_iconv_handler(), so you should call it at the beginning of your script (prior to any output). * Automatically transform output between character sets * * @param string $ocs desired output character set * @param string $ics current intput character set * @return Returns TRUE on success, PEAR_Error on failure. */ public function autoConv($ocs, $ics) { try { I18Nv2::autoConv($ocs, $ics); } catch (Exception $e) { $this->errorCallback('Caught exception: ' . $e->getMessage()); exit; } }