Re: Foreign character sets?
Phil Daintree <
phil@...>
2008-09-02 11:09:51 GMT
The hack you have adopted will translate the character string UTF-8 and
use the translated string as the character set.
I see the issue and yes the business needs to use a common language
through out - but it is often necessary for users in other countries to
see the interface in their language - which often means a different
character set.
Phil
Nicholas Lee wrote:
> I've figured out that the charset of the http connection
> (Content-Type=etc) and the DB connection (see 2nd diff) are dependent on
> the user language. I can't say that I'm an expert on character sets,
> but this strikes me as problematic.
>
>
> 1. Inserting/Editing data in the database dependent on user language
> seems to be asking for trouble:- two users with different
> character sets are going to see different data. Better to have a
> consistent charset used in the database.
> 2. Furthermore, multiple languages implies multiple languages
> (character sets) to display, implies multiple character sets to
> store in the database. This again seems lead to so problems.
>
>
> I would think it would be better to have a consistent default character
> set, maybe UTF-8, for weberp.
>
>
>
> Anyway I hack the code a little to switch to UTF-8.
>
> --- header.inc 2008-09-02 03:25:03.000000000 +0000
> +++ header.inc.orig 2008-09-02 03:24:42.000000000 +0000
> <at> <at> -7,7 +7,7 <at> <at>
> // $title - should be defined in the page this file is included
> with
>
> if (!headers_sent()){
> - header('Content-type: text/html; charset=' . _('UTF-8'));
> + header('Content-type: text/html; charset=' .
> _('ISO-8859-1'));
> }
> echo '<!doctype html public "-//W3C//DTD HTML 4.01
> Transitional//EN">';
>
> <at> <at> -15,7 +15,7 <at> <at>
> echo '<html><head><title>' . $title . '</title>';
> echo '<link REL="shortcut icon" HREF="'. $rootpath.'/favicon.ico">';
> echo '<link REL="icon" HREF="' . $rootpath.'/favicon.ico">';
> - echo '<meta http-equiv="Content-Type" content="text/html; .
> _('UTF-8') . '">';
> + echo '<meta http-equiv="Content-Type" content="text/html;
> charset=' . _('ISO-8859-1') . '">';
> echo '<link href="'.$rootpath. '/css/'. $_SESSION['Theme']
> .'/default.css" REL="stylesheet" TYPE="text/css">';
> echo '</head>';
>
> <at> <at> -76,4 +76,4 <at> <at>
> echo '</tr>';
> echo '</table>';
>
> -?>
> +?>
>
>
> --- ./ConnectDB_mysqli.inc 2008-09-02 03:31:24.000000000 +0000
> +++ ./ConnectDB_mysqli.inc.orig 2008-09-02 03:28:14.000000000 +0000
> <at> <at> -159,7 +159,7 <at> <at>
>
> function DB_escape_string($String){
> global $db;
> - return mysqli_real_escape_string($db, htmlspecialchars($String,
> ENT_COMPAT, _('UTF-8')));
> + return mysqli_real_escape_string($db, htmlspecialchars($String,
> ENT_COMPAT, _('ISO-8859-1')));
> }
>
> function DB_show_tables(&$Conn){
>
>
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> web-ERP-users mailing list
> web-ERP-users@...
> https://lists.sourceforge.net/lists/listinfo/web-erp-users
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/