[Svn] r1927 - in trunk/roundcubemail: . program/include

Dennis P. Nikolaenko dennis at nikolaenko.ru
Fri Oct 3 10:11:18 CEST 2008


trac at roundcube.net wrote:
> Author: alec
> Date: 2008-10-03 03:05:59 -0500 (Fri, 03 Oct 2008)
> New Revision: 1927
>
> Modified:
>    trunk/roundcubemail/CHANGELOG
>    trunk/roundcubemail/program/include/rcube_shared.inc
>    trunk/roundcubemail/program/include/rcube_vcard.php
> Log:
> - Add support for SJIS, GB2312, BIG5 in rc_detect_encoding()
> - Fix vCard file encoding detection for non-UTF-8 strings (#1485410)
>
>
> Modified: trunk/roundcubemail/CHANGELOG
> ===================================================================
> --- trunk/roundcubemail/CHANGELOG	2008-10-03 06:58:06 UTC (rev 1926)
> +++ trunk/roundcubemail/CHANGELOG	2008-10-03 08:05:59 UTC (rev 1927)
> @@ -1,6 +1,10 @@
>  CHANGELOG RoundCube Webmail
>  ---------------------------
>  
> +2008/10/03 (alec)
> +- Add support for SJIS, GB2312, BIG5 in rc_detect_encoding()
> +- Fix vCard file encoding detection for non-UTF-8 strings (#1485410)
> +
>  2008/10/02 (alec)
>  ----------
>  - Minimize "inline" javascript scripts use (#1485433)
>
> Modified: trunk/roundcubemail/program/include/rcube_shared.inc
> ===================================================================
> --- trunk/roundcubemail/program/include/rcube_shared.inc	2008-10-03 06:58:06 UTC (rev 1926)
> +++ trunk/roundcubemail/program/include/rcube_shared.inc	2008-10-03 08:05:59 UTC (rev 1927)
> @@ -249,17 +249,17 @@
>    if ($bytes > 1073741824)
>    {
>      $gb = $bytes/1073741824;
> -    $str = sprintf($gb>=10 ? "%d " : "%.1f ", $gb) . rcube_label('GB');
> +    $str = sprintf($gb>=10 ? "%d GB" : "%.1f GB", $gb);
>    }
>    else if ($bytes > 1048576)
>    {
>      $mb = $bytes/1048576;
> -    $str = sprintf($mb>=10 ? "%d " : "%.1f ", $mb) . rcube_label('MB');
> +    $str = sprintf($mb>=10 ? "%d MB" : "%.1f MB", $mb);
>    }
>    else if ($bytes > 1024)
> -    $str = sprintf("%d ",  round($bytes/1024)) . rcube_label('KB');
> +    $str = sprintf("%d KB",  round($bytes/1024));
>    else
> -    $str = sprintf('%d ', $bytes) . rcube_label('B');
> +    $str = sprintf('%d B', $bytes);
>  
>    return $str;
>  }
> @@ -548,10 +548,12 @@
>      // FIXME: the order is important, because sometimes 
>      // iso string is detected as euc-jp and etc.
>      $enc = array(
> -	'UTF-8', 'ISO-8859-1', 'ISO-8859-2', 'ISO-8859-3', 'ISO-8859-4',
> +	'SJIS', 'BIG5', 'GB2312', 'UTF-8',
> +	'ISO-8859-1', 'ISO-8859-2', 'ISO-8859-3', 'ISO-8859-4',
>  	'ISO-8859-5', 'ISO-8859-6', 'ISO-8859-7', 'ISO-8859-8', 'ISO-8859-9',
>  	'ISO-8859-10', 'ISO-8859-13', 'ISO-8859-14', 'ISO-8859-15', 'ISO-8859-16',
> -	'WINDOWS-1252', 'WINDOWS-1251', 'EUC-JP', 'EUC-TW', 'KOI8-R'
> +	'WINDOWS-1252', 'WINDOWS-1251', 'EUC-JP', 'EUC-TW', 'KOI8-R', 
> +	'ISO-2022-KR', 'ISO-2022-JP'
>      );
>  
>      $result = mb_detect_encoding($string, join(',', $enc));
>
> Modified: trunk/roundcubemail/program/include/rcube_vcard.php
> ===================================================================
> --- trunk/roundcubemail/program/include/rcube_vcard.php	2008-10-03 06:58:06 UTC (rev 1926)
> +++ trunk/roundcubemail/program/include/rcube_vcard.php	2008-10-03 08:05:59 UTC (rev 1927)
> @@ -396,6 +396,9 @@
>      if (substr($string, 0, 2) == "\xFF\xFE")     return 'UTF-16LE';  // Little Endian
>      if (substr($string, 0, 3) == "\xEF\xBB\xBF") return 'UTF-8';
>  
> +    if ($enc = rc_detect_encoding($string))
> +      return $enc;
> +
>      // No match, check for UTF-8
>      // from http://w3.org/International/questions/qa-forms-utf-8.html
>      if (preg_match('/\A(
>
> _______________________________________________
> http://lists.roundcube.net/mailman/listinfo/svn
>   
Are localized file sizes gone?

-- 
Regards,
Dennis P. Nikolaenko

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list