P
P
Peter2013-12-16 16:14:47
PHP
Peter, 2013-12-16 16:14:47

Problems with encoding and Doctrine

Hello
, I have come across this situation.
We have:
1. Hosting with database. Encoding utf ( d.pr/i/CBSU )
2. Hosting with a project on Silex that accesses the database on hosting #1.
DB connection uses charset - UTF
On the output page charset - UTF.
However, when fetchAll from the database, we get Cyrillic data in the form: �� ��������� d.pr/i/zzGi
For correct display, we have to do:
$data = iconv("Windows-1251", "UTF-8", $data);
Any advice?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vit, 2013-12-16
@Alcospb

The fact that phpmyadmin tables are encoded in utf-8 does not mean that there is really utf-8 inside. I once dumped the database in a similar situation, converted it to utf-8 and poured it back.

S
shagguboy, 2013-12-16
@shagguboy

set names 'utf-8'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question