Topic: UTF-8
After this modification i have - any date in datebase in any languages.
A have in datebase - Rusian, English , Latvia - (Аги.(Āģī)) in one string.
Need Export all tables from mysql and chnage this dump file to UTF-8.
Change in dump file where; DEFAULT CHARSET=*** COLLATE=**** >-TO-> DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;
Make new database with - DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;
And import file with you date.
Than install Eny UTF-8 language in FA, Make this dafault. Take language file *.po *.mo from english - convert this files to files with UTF-8 encoding. And put files in you any UTF-8 language in FA.
Notepad++ work great for convert between encodind.
Than change down.
* ..\frontaccount\includes\db\connect_db.inc
function db_query($sql, $err_msg=null)
Add like this
//My change: for UTF-8
mysql_query("SET NAMES 'utf8';");
mysql_query("SET CHARACTER SET 'utf8';");
mysql_query("SET SESSION collation_connection = 'utf8_general_ci';");
//My change: for UTF-8
-----------------
* ..\frontaccount\includes\ui\ui_input.inc
Change
//htmlentities(strtr($name, array('.'=>'=2E',' '=>'=20','='=>'=3D','['=>'=5B')))......
htmlspecialchars(strtr($name, array('.'=>'=2E',' '=>'=20','='=>'=3D','['=>'=5B'))......
function button($name, $value, $title=false, $icon=false, $aspect='')
{
// php silently changes dots,spaces,'[' and characters 128-159
// to underscore in POST names, to maintain compatibility with register_globals
$rel = '';
if ($aspect == 'selector') {
$rel = " rel='$value'";
$value = _("Select");
}
if (user_graphic_links() && $icon)
{
if ($value == _("Delete")) // Helper during implementation
$icon = ICON_DELETE;
return "<button type='submit' class='editbutton' name='".
//htmlentities(strtr($name, array('.'=>'=2E',' '=>'=20','='=>'=3D','['=>'=5B')))
htmlspecialchars(strtr($name, array('.'=>'=2E',' '=>'=20','='=>'=3D','['=>'=5B')), ENT_COMPAT, $_SESSION['language']->encoding )
."' value='1'" . ($title ? " title='$title'":" title='$value'")
. ($aspect ? " aspect='$aspect'" : '')
. $rel
." />".set_icon($icon)."\n";
}
else
return "<input type='submit' class='editbutton' name='".
//htmlentities(strtr($name, array('.'=>'=2E',' '=>'=20','='=>'=3D','['=>'=5B')))
htmlspecialchars(strtr($name, array('.'=>'=2E',' '=>'=20','='=>'=3D','['=>'=5B')), ENT_COMPAT, $_SESSION['language']->encoding )
."' value='$value'"
.($title ? " title='$title'":'')
. ($aspect ? " aspect='$aspect'" : '')
. $rel
." />\n";
}
---------------
..\frontaccount\inventory\manage\item_units.php
//MY change:
// write_item_unit(htmlentities($selected_id), $_POST['abbr'], $_POST['description'], $_POST['decimals'] );
write_item_unit(htmlspecialchars($selected_id), $_POST['abbr'], $_POST['description'], $_POST['decimals'], ENT_COMPAT, $_SESSION['language']->encoding );
//MY change:
----------------
May be also need config mysql
MySQL server my.cnf or Windows my.ini:
[client]
default-character-set= utf8
[mysql]
collation_server = utf8_unicode_ci
character_set_server = utf8
default-character-set=utf8
init-connect='SET collation_connection = utf8_general_ci'
init-connect='SET NAMES utf8'
[mysqld]
default-character-set=utf8