Changeset 1761

Show
Ignore:
Timestamp:
08/04/08 23:24:59 (4 months ago)
Author:
mikey
Message:

enhancement #87: set internal iconv encoding to UTF-8, try to detect external encoding and set input and output encoding accordingly

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • framework/trunk/src/main/php/net/stubbles/stubClassLoader.php

    • Property svn:keywords set to Id
    r1372 r1761  
    66 * @author   Stephan Schmidt <schst@stubbles.net> 
    77 * @package  stubbles 
     8 * @version     $Id$ 
    89 */ 
    910/** 
     
    340341} 
    341342/** 
     343 * set internal, input and output encoding 
     344 */ 
     345iconv_set_encoding('internal_encoding', 'UTF-8'); 
     346if (($ctype = getenv('LC_CTYPE')) || ($ctype = setlocale(LC_CTYPE, 0))) { 
     347    sscanf($ctype, '%[^.].%s', $language, $charset); 
     348    if (is_numeric($charset) === true) { 
     349        $charset = 'CP' . $charset; 
     350    } 
     351     
     352    iconv_set_encoding('output_encoding', $charset); 
     353    iconv_set_encoding('input_encoding', $charset); 
     354} 
     355/** 
    342356 * make the stubObject class available so there is no need to include it in 
    343357 * every other class that should extend it