0
votes

I have a modx site that outputs some dates on a bunch of different pages in both English and French - it worked fine but now the owner is reporting French dates showing 'funny characters'

The database, modx and page are all using UTF8 encoding, the date value (publishedon) is stored as a unix time in the data base and is called like this:

[[+publishedon:strtotime:date=`%B  %e, %Y`]]

Which from my understanding is just using the php strtotime function, however on the French pages the date shows up as:

d�cembre 18, 2018

So the Locale functions are working but not the character set, NOW immediately fog that date is some copy from the database:

"Le 18 décembre"

Using the correct characters, so we can see the encoding for the page is correct, but the function appears to be not using the correct character encoding!?

Modx has not been updated.

Does anyone know what might be going on here and how to set the corect encoding for the output?

UPDATED INFORMATION:

  • there are 2 web contexts defined, English and French. Each has a locale defines as en_EN & fr_FR respectively
  • the modx_charset is UTF-8 set in the system settings
  • use_multibyte is enabled in the system settings an mbstring is installed & enabled on the server.
  • modx version is 2.6.5
2

2 Answers

1
votes

Use an utf8 capable locale MODX system setting, like fr_FR.utf8 or similar.

You have to look before, which locales are available on your host.

0
votes

it worked fine but now the owner is reporting French dates showing 'funny characters'

It's interesting what happened and became the cause..maybe some server updates take place? Sometimes hoster makes an indelible contribution :) What encoding do you have now in php.ini file? Additionally what MODX version do you use? Also please let know what stored for next modx system settings(directly or redefined by context settings):

locale, modx_charset, use_multibyte

Br, Anton