Topic: Can't read/save Polish characters

I installed Polish language and English (US) language. However, no matter which language I set, I can't save Polish characters.

For example, in "Add and Manage Customers", if the customer name contains a Polish character, there will be errors after I press 'Add Customer' - Errors say:

The customer name cannot be empty.
/home1/dragon/public_html/dragondb/includes/ui/ui_msgs.inc:14:    trigger_error('The customer name cannot be empty.','256')
/home1/dragon/public_html/dragondb/sales/manage/customers.php:42:    display_error('The customer name cannot be empty.')
/home1/dragon/public_html/dragondb/sales/manage/customers.php:84:    can_process()
/home1/dragon/public_html/dragondb/sales/manage/customers.php:142:    handle_submit('')


I also tried updating records on the back-end tables through PhpMyAdmin. The Polish characters can be saved at the back-end tables. However, after I wanted to view it in the frontaccounting system again, those characters became '???' again.

What should I do to solve this?

Re: Can't read/save Polish characters

This problem is related to uncompatibilities in htmlspecialchars() fucntion behaviour in newer php versions. This  just have been fixed in FA source repository, and will be released with next minor FA version.  If you want to fix it manually on your installation, just apply this patch  on FA sources.
Janusz

Re: Can't read/save Polish characters

Should this not be extended to not just Polish but even when no session encoding is present like in the default C or null encoding?

Re: Can't read/save Polish characters

This is latin2 encoding related fix which is used  not only for polish language. Probably the same problem could arise for other encodings not supported by htmlspecialchars(). For now nobody was interested in contributing any translation which use encoding other than  latin1, latin2 or utf8 (see list of avilable languages), so frankly I don't care about that. The patch fixes the problem for all currently supported languages, and this is safe minimum.

Janusz

Re: Can't read/save Polish characters

After following the steps in  this patch, the error messages are now gone. But I still see "?" for all polish characters in both system and PDF. i.e. I still cannot see Polish characters.

I tried looking for other answers on the internet but cannot get a good solution. I downloaded the fonts dejavu and freesans but still does not work. I am getting frustrated.... What else should I do to rectify this? Thank you.

Re: Can't read/save Polish characters

Check the database and see if it is stored correctly there - if not then it could be an encoding issue in your database.

Re: Can't read/save Polish characters

I finally solved the problem as per the suggestion in an earlier post. Thanks everyone for your help.

https://frontaccounting.com/punbb/viewtopic.php?id=4530&login=1

Re: Can't read/save Polish characters

Thanks for the info. The solution in context is:

Solution
=================
in file includes/db/connect_db.inc
add one line
mysql_query("SET NAMES 'utf8'");

so the code become below
====
$db = mysql_connect($connection["host"], $connection["dbuser"], $connection["dbpassword"]);
   
mysql_query("SET NAMES 'utf8'");
        mysql_select_db($connection["dbname"], $db);
====