Hi,
I have a problem with the encoding of the Russian language in the transfer xlsx file into MySQL database. On the this page http://gefestholding.ru/modul/ you can see my efforts. Can anyone advise me how to set encoding? To convert using php class (SimpleXLSX.class). Thank you for your answer.

Recommended Answers

All 4 Replies

Member Avatar for LastMitch

@toredor

upload xlsx into database

Since you didn' provide any code regarding how you insert your data. I assume you didn't set the entire MySQL database character-set to UTF-8? On your form when you submit the data make sure the encoding is UTF-8, by setting Content-Type to text/html; charset=utf-8.

Member Avatar for diafol

If your xlsx handling script does not have html (I'm assuming it doesn't) - then you won't be using a meta tag for the charset, so use the header() to set it.

I have a whole database set to utf-8, but the problem with encoding when reading data from a xlsx file that contains Russian language.
Can you please show me how to set the function header ()? Thank you

Member Avatar for diafol
header('Content-Type: text/html; charset=utf-8');

As mentioned by LastMitch. Google'd give you that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.