0


I need for a php script support for cyrillic characters.
/etc/php5/cli/PHP.ini:

default_charset = "UTF-8"

My script asks values from a MySQL table (collation: utf8_general_ci) and write those values inside a php variable.

The output of the script is just "???" instead of text, so I guess there is still a problem with a wrong charset, if that MySQL value is a normal latin text, the output of that script is fine.

The website itself works fine with cyrillic letters, only at command line I have these problems.

Do I have to give some additional options at command line?

fips123
  • 261
  • 2
  • 11

1 Answers1

1

The solution is to specify which charset has to be used when sending data from database.
After I add following line to my script, cyrillic characters where shown without problems. mysqli_set_charset($conn, 'utf8');

fips123
  • 261
  • 2
  • 11