Changeset b1fb698 in github


Ignore:
Timestamp:
Jun 3, 2009 2:45:39 PM (4 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
42b25af
Parents:
024130b
Message:
  • added more charset aliases
File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/include/main.inc

    rca85b1c rb1fb698  
    244244    } 
    245245    else if ($from != 'UTF-8' && $conv) { 
    246       $from = preg_replace(array('/^WINDOWS-*/', '/^CP-/'), array('CP', 'CP'), $from); 
     246      $from = preg_replace(array('/^WINDOWS-*125([0-8])$/', '/^CP-/'), array('CP125\\1', 'CP'), $from); 
    247247      $conv->loadCharset($from); 
    248248      $str = $conv->strToUtf8($str); 
     
    265265    } 
    266266    else if ($to != 'UTF-8' && $conv) { 
    267       $to = preg_replace(array('/^WINDOWS-*/', '/^CP-/'), array('CP', 'CP'), $to); 
     267      $to = preg_replace(array('/^WINDOWS-*125([0-8])$/', '/^CP-/'), array('CP125\\1', 'CP'), $to); 
    268268      $conv->loadCharset($to); 
    269269      return $conv->utf8ToStr($str); 
     
    306306  $charset = str_replace('UNICODE-1-1-', '', $charset); 
    307307 
     308  # Aliases: some of them from HTML5 spec. 
    308309  $aliases = array( 
    309310    'USASCII'       => 'WINDOWS-1252', 
     
    314315    'XUSERDEFINED'  => 'ISO-8859-15', 
    315316    'KSC56011987'   => 'EUC-KR', 
    316     'GB2312'        => 'GB18030', 
     317    'GB2312'        => 'GBK', 
     318    'GB231280'      => 'GBK', 
    317319    'UNICODE'       => 'UTF-8', 
    318     'UTF7IMAP'      => 'UTF7-IMAP' 
     320    'UTF7IMAP'      => 'UTF7-IMAP', 
     321    'XXBIG5'        => 'BIG5', 
     322    'TIS620'        => 'WINDOWS-874', 
     323    'ISO88599'      => 'WINDOWS-1254', 
     324    'ISO885911'     => 'WINDOWS-874', 
    319325  ); 
    320326 
Note: See TracChangeset for help on using the changeset viewer.