1

(4 replies, posted in Setup)

Thank you apmuthu for your reply, but I'm not sure I understand what you are suggesting. The various posts all seem to be struggling with the same issue, but no definitive answer.

In my mind, when reading from the MySQL database the Front Accounting code should be decoding the strings from the MySQL table encoding into whatever the PHP native encoding is. On display, the strings should be decoded from the PHP native encoding to whatever encoding is being used for the HTML, replacing HTML special characters as appropriate. If the data in the database looks OK, but the data on the web UI looks wrong then there must be an issue with this process, no?

Is there an equivalent function to db_escape which does this process in reverse and is used by all database calls?

I'm not sure what you are saying by "see how you want to implement it" -- I'm just trying to use/setup the Front Accounting package.

Thanks

2

(4 replies, posted in Setup)

I am using Front Accounting 2.3.22 on Gentoo with MySQL 5.5.40. The default character encoding for my system and MySQL is UTF-8. I have installed the "British COA" 2.3.0-5, which is an iso-8859-1 chart of accounts.

I have entered some setup data via the Simple API module.

I am noticing that names and address with accented characters submitted via the API look correct when viewed from the MySQL client. However, from the Front Accounting application the accented characters appear corrupted.

On the other hand, accented characters entered via the application look corrupted from the MySQL database client, but reappear correctly in the UI.

It looks like there is some sort of encoding issue. All of my MySQL tables are set to UTF-8, which is the system default.

This posting suggests that all database tables should be latin1. If this is the case it strikes me that the charset for the database tables is not being set to this on database creation.

The table creation script en_GB-general.sql which I presume was used to create my database tables does not set the charset for the tables, except for 2 tables where the charset is set to UTF-8, so it is not surprising the created tables ended up with the default.

I have tried dumping my database, setting CHARTSET=latin1 for every CREATE TABLE and reimporting but this has not resolved the problem.

Any suggestions as to what I can try next to resolve the encoding mismatch between the database and Front Accounting?

Thanks.