Changeset abdc589 in github


Ignore:
Timestamp:
Oct 3, 2008 4:05:59 AM (5 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
2cc1cac
Parents:
0bfbe62
Message:
  • Add support for SJIS, GB2312, BIG5 in rc_detect_encoding()
  • Fix vCard file encoding detection for non-UTF-8 strings (#1485410)
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    r5285146 rabdc589  
    11CHANGELOG RoundCube Webmail 
    22--------------------------- 
     3 
     42008/10/03 (alec) 
     5- Add support for SJIS, GB2312, BIG5 in rc_detect_encoding() 
     6- Fix vCard file encoding detection for non-UTF-8 strings (#1485410) 
    37 
    482008/10/02 (alec) 
  • program/include/rcube_shared.inc

    r56cf503 rabdc589  
    250250  { 
    251251    $gb = $bytes/1073741824; 
    252     $str = sprintf($gb>=10 ? "%d " : "%.1f ", $gb) . rcube_label('GB'); 
     252    $str = sprintf($gb>=10 ? "%d GB" : "%.1f GB", $gb); 
    253253  } 
    254254  else if ($bytes > 1048576) 
    255255  { 
    256256    $mb = $bytes/1048576; 
    257     $str = sprintf($mb>=10 ? "%d " : "%.1f ", $mb) . rcube_label('MB'); 
     257    $str = sprintf($mb>=10 ? "%d MB" : "%.1f MB", $mb); 
    258258  } 
    259259  else if ($bytes > 1024) 
    260     $str = sprintf("%d ",  round($bytes/1024)) . rcube_label('KB'); 
    261   else 
    262     $str = sprintf('%d ', $bytes) . rcube_label('B'); 
     260    $str = sprintf("%d KB",  round($bytes/1024)); 
     261  else 
     262    $str = sprintf('%d B', $bytes); 
    263263 
    264264  return $str; 
     
    549549    // iso string is detected as euc-jp and etc. 
    550550    $enc = array( 
    551         'UTF-8', 'ISO-8859-1', 'ISO-8859-2', 'ISO-8859-3', 'ISO-8859-4', 
     551        'SJIS', 'BIG5', 'GB2312', 'UTF-8', 
     552        'ISO-8859-1', 'ISO-8859-2', 'ISO-8859-3', 'ISO-8859-4', 
    552553        'ISO-8859-5', 'ISO-8859-6', 'ISO-8859-7', 'ISO-8859-8', 'ISO-8859-9', 
    553554        'ISO-8859-10', 'ISO-8859-13', 'ISO-8859-14', 'ISO-8859-15', 'ISO-8859-16', 
    554         'WINDOWS-1252', 'WINDOWS-1251', 'EUC-JP', 'EUC-TW', 'KOI8-R' 
     555        'WINDOWS-1252', 'WINDOWS-1251', 'EUC-JP', 'EUC-TW', 'KOI8-R',  
     556        'ISO-2022-KR', 'ISO-2022-JP' 
    555557    ); 
    556558 
  • program/include/rcube_vcard.php

    rbb8781c6 rabdc589  
    397397    if (substr($string, 0, 3) == "\xEF\xBB\xBF") return 'UTF-8'; 
    398398 
     399    if ($enc = rc_detect_encoding($string)) 
     400      return $enc; 
     401 
    399402    // No match, check for UTF-8 
    400403    // from http://w3.org/International/questions/qa-forms-utf-8.html 
Note: See TracChangeset for help on using the changeset viewer.