M
M
Mussi2014-07-14 07:45:15
PHP
Mussi, 2014-07-14 07:45:15

Php+oracle problems with encoding, how to remove questions and output Cyrillic?

People, help, the whole brain has already turned over with this problem. There is a serv on orakle, there is an application on puff. Everything in Oracle is encoded in cp-866, in Cyrillic letters, I make a selection, I display it on the screen - on locales (win xp sp3, apache 2.2.25, php 5.4.29, mod_fcgid 2.3.6) everything is fine and the letters are displayed normally.
He asked me to raise a serv on a virtual machine in order to place the application there. Transferred everything there, only win 7 and the oracle client installed instantclient-basic-nt-12.1.0.1.0
Here troubles arose, instead of Russian symbols it displays question marks. Changing the page encoding in the browser did not help (the default page encoding is win1251),
iconv($str,'CP866','CP-1251') Doesn't work, although the function worked fine on my locale. That is, numbers and signs are read normally, and Russian letters are replaced with questions. mb_detect_encoding returns the ansii encoding. please help me to find out and solve the problem

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Evgeny Komarov, 2014-07-14
@maNULL

Check the encoding:
1. The NLS_LANG parameter of the oracle client (in the registry, edit the handles, because it defaults to 1252)
2. When creating a connection, explicitly specify the base encoding

P
Puma Thailand, 2014-07-14
@opium

There is a problem in the Apache code, by default there is something like AddDefaultCharset UTF-8,
in fact, this caused me the same problem with some sites cp866

O
OnYourLips, 2014-07-14
@OnYourLips

In Oracle, everything is contained in cp-866 encoding, in Cyrillic letters

Encode the data in the database to UTF-8 and work with UTF-8.
When working with UTF-8, there are no such problems. No need to use old exotic encodings. You create problems for yourself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question