E
E
EvgMul2016-09-21 16:27:28
PHP
EvgMul, 2016-09-21 16:27:28

What is the problem with hosting encoding?

Hello. Problem following: there is a script which generates a CSV file. The script contains a line like this:

$resultData = mb_convert_encoding($resultData, 'windows-1251');

If I run the script locally and open the resulting file via exel, then Cyrillic is displayed correctly.
I transfer the entire script to the hosting, run it there and get bugs (mostly question marks).
If you do not use this conversion function, then I get a normal string in UTF-8.
Tell me please, what could be the problem?
Thanks in advance to all who respond.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mercury13, 2016-09-21
@EvgMul

$resultData = mb_convert_encoding($resultData, 'Windows-1251', 'UTF-8');

I think the auto-detection of the encoding is glitched.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question