~ubuntu-branches/ubuntu/hardy/squirrelmail/hardy-updates

« back to all changes in this revision

Viewing changes to functions/decode/cp1258.php

  • Committer: Bazaar Package Importer
  • Author(s): Thijs Kinkhorst
  • Date: 2005-02-06 21:41:51 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050206214151-z4n1o8mnttgzuj0y
Tags: 2:1.4.4-3
* Move default_pref config file from /var to /etc, as per Debian policy
  (Closes: #293281)
* [JvW] (finally) override two lintian warnings about nonstandard
  permissions that are intentional (Closes: #293366)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
2
/**
3
3
 * decode/cp1258.php
4
 
 * $Id: cp1258.php,v 1.2 2003/10/28 21:27:47 tassium Exp $
5
4
 *
6
 
 * Copyright (c) 2003 The SquirrelMail Project Team
 
5
 * Copyright (c) 2003-2005 The SquirrelMail Project Team
7
6
 * Licensed under the GNU GPL. For full terms see the file COPYING.
8
7
 *
9
8
 * This file contains cp1258 decoding function that is needed to read
18
17
 *   Table format:  Format A
19
18
 *   Date:          04/15/98
20
19
 *   Contact:       cpxlate@microsoft.com
 
20
 *
 
21
 * @version $Id: cp1258.php,v 1.1.4.6 2004/12/27 15:03:47 kink Exp $
21
22
 * @package squirrelmail
22
23
 * @subpackage decode
23
24
 */
28
29
 * @return string $string Decoded string
29
30
 */
30
31
function charset_decode_cp1258 ($string) {
31
 
    global $default_charset;
32
 
 
33
 
    if (strtolower($default_charset) == 'windows-1258')
34
 
        return $string;
35
 
 
36
 
    /* Only do the slow convert if there are 8-bit characters */
37
 
    /* avoid using 0xA0 (\240) in ereg ranges. RH73 does not like that */
38
 
    if (! ereg("[\200-\237]", $string) and ! ereg("[\241-\377]", $string) )
 
32
    // don't do decoding when there are no 8bit symbols
 
33
    if (! sq_is8bit($string,'windows-1258'))
39
34
        return $string;
40
35
 
41
36
    $cp1258 = array(