[dev] [patch]Config problem

Jan Schneider jan at horde.org
Thu Dec 9 07:01:48 PST 2004


Zitat von 張良文 <david at tmv.gov.tw>:

> Hi there:
> I noted that saving paramaters e.g,WHUPS/default priorities & states 
> to conf.php
> via admin/setup/config.php were formatted as ISO8859-1.
>
> Once i saved these variables in Chinese,and next time when create default
> priorities & states in "Edit Types" ,these setting were loaded with ISO8859-1
> from conf.php and writed to sql backend.

This is not the correct solution, and honestly, I don't know how to
correctly handle this. The generated PHP code needs to be ISO-8859-1,
otherwise the PHP parser will choke if not especially prepared for taking
other charsets through mbstring.

> Here are what i patched:
>
> --- ./admin/setup/config.php.orig        Thu Dec  9 10:03:57 2004
> +++ ./admin/setup/config.php        Thu Dec  9 09:25:23 2004
> @@ -66,7 +66,7 @@
>      }
>      if ($fp = @fopen($path . '/conf.php', 'w')) {
>          /* Can write, so output to file. */
> -        fwrite($fp, String::convertCharset($php, NLS::getCharset(),
> 'iso-8859-1'));
> +        fwrite($fp, String::convertCharset($php, NLS::getCharset(),
> $GLOBALS['conf']['sql']['charset']));
>          fclose($fp);
>          $notification->push(sprintf(_("Successfully wrote %s"), $path .
> '/conf.php'), 'horde.success');
>      } else {
>
>
>
>
> --- ./framework/Horde/Horde/Config.php.orig        Tue Oct 19 08:45:27 2004
> +++ ./framework/Horde/Horde/Config.php        Thu Dec  9 10:02:18 2004
> @@ -654,7 +654,7 @@
>              }
>          }
>          if (is_string($ptr)) {
> -            return String::convertCharset($ptr, 'iso-8859-1');
> +            return String::convertCharset($ptr,
> $GLOBALS['conf']['sql']['charset']);
>          } else {
>              return $ptr;
>          }

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/


More information about the dev mailing list