Topic: UTF8 double encoding

So, I have some UTF8 encoding character. I have setup my mysql collation to utf8. I also make sure before querying into the database, I setup the encoding for the php-mysql connection using mysql_set_charset function.  It works fine and I have checked it is stored in the database as UTF8. If I query a string using the utf8 character, it returns what I want.

Then I setup the installed language encoding into utf8. I just realized there are something wrong. It doesn't display the character correctly. I think if I set it to utf8 in the installed language, FA seems decode the utf8 again although from the database, it is already utf8. Then I changed the encoding in the installed language into standard iso encoding and it works.

My question is, is it normal like this? How does FrontAccounting handle the character encoding?

Re: UTF8 double encoding

Make sure that the default / current session / connection are all of the same charset.
Check on the values of the concerned MySQL variables.

Re: UTF8 double encoding

should I call mysql_set_charset function in every database connection? I thought I saw in the code it is already set so that it is the same as the encoding from the default language. I also check the mta tag of the html it is already utf8.

Re: UTF8 double encoding

This is specific to the mysqli_query execution where the connection handle is passed.

Re: UTF8 double encoding

I am using 2.3.26 and I add mysql_set_charset in the end of db_connection function. It works. It seems every time PHP making mysql connection, the encoding need to be set. I thinj FA 2.4 already handles this, right?

Re: UTF8 double encoding

If your OS starts the MySQL server with the right default charset and collation and it matches that of the connection made from the php scripts, all should be well. This will affect both FA 2.3 and FA 2.4 as well.