Languages not appearing in CMS correctly but are in database correct

7 posts by 2 authors in: Forums > CMS Builder
Last Post: March 26   (RSS)

By Twocans - September 17, 2019

Hi yea,
I have a table (Table type is InnoDB ) I have multi languages in that table, when I view my db using navicat all is fine, but when I view the chinese etc in the cms wow the text appears as gobbledygook, see imagine attached.

Thanks for any input

Kenny

Attachments:

2019-09-17-12_11_11.png 116K

By Twocans - September 17, 2019

I believe the issue stems from the CMS as it is the latest download cmsbuilder_3_53_build2265_release, and I see it creates the tables as InnoDB and no longer as MYISAM as it did in the other cms I have used.Both the InnoDB and the MYISAM have the collation value utf8mb4_unicode_ci

In the past when I built multilingual I was able to use the MYISAM no bother. wow, if you can give me any tips on what I can set with the cms for the new InnoDB I would be grateful.


cheers

Kenny

By daniel - September 17, 2019

Hi Kenny,

To my knowledge, the MyISAM vs. InnoDB shouldn't have a big impact on character encoding, so this is a curious issue. You mentioned in a previous thread that you were dealing with importing/exporting data - is that the case here? If so, is there anything different in your import/export process from when it worked previously? 

Let me know and I can hopefully offer some steps for troubleshooting.

Thanks,

Daniel
PHP Programmer
interactivetools.com

By daniel - September 23, 2019

Hi Kenny,

Thanks for the detailed documentation! I believe I've narrowed down the issue to a setting in the CSV Import plugin. This line in csvImport.php:

  'ENCODING'              => 'CP1252', // CP1252, ASCII, ISO-8859-1, UTF-8 - More: http://php.net/manual/en/mbstring.supported-encodings.php

Can be changed to use UTF-8:

  'ENCODING'              => 'UTF-8', // CP1252, ASCII, ISO-8859-1, UTF-8 - More: http://php.net/manual/en/mbstring.supported-encodings.php

After changing this, I was able to import your CSV (the one from Navicat) with the correct character set displaying in an InnoDB table.

Let me know if that helps, or if you have any more questions!

Thanks,

Daniel
PHP Programmer
interactivetools.com

By Twocans - September 30, 2019

Daniel Thank you

I had tried what you mentioned but to no avail, BUT I have since discovered something.

OK my hosting company shifted some of my sites over the mariadb, that should not have made that much of a difference but on this occasion it did. as no matter what I did with the import export plugins etc and navicat 12 for mysql. anyway I purchased Navicat for mariadb, I exported the table which was working on one of my sites using this, then imported the csv using navicat for mariadb on my new site, and Bingo its perfect. I am totally confused as the csv are both the same, ok slight dif in date but that was easily changed. But the CSV itself opening it in notepad its the same as the one with mariaDB but the mariaDB export import works fine. Now all languages etc are no longer gobbledygook and are clear to be able to be read.

Sorry about the late reply I was away

Cheers

Kenny

By Twocans - March 26

Thank you Daniel,
Ok sorry for very late reply but wow, i had another poke at it and, here is

When using navicat to export records, navicat does so using a Binary Data Encoding in a listmenu of Base64, (in step 4 of the navicat export wizard)..... anyway I change that to None and bingo, all is fine.

Hope you guys are all well

cheers

k