WickedShell / echelon

http://echelon.bigbrotherbot.net
14 stars 7 forks source link

Chatlog and Cyrillic #47

Open ghost opened 12 years ago

ghost commented 12 years ago

In chatlog not display Cyrillic characters: http://s017.radikal.ru/i400/1111/3e/d80da7ba4875.jpg http://s017.radikal.ru/i424/1111/03/dbef149370b6.jpg http://i027.radikal.ru/1111/47/3a885d600895.jpg

WickedShell commented 12 years ago

I suspect this is an issue with char set. If you open inc/header.php on line 35 it says;

try changing that to the following; ""

I believe that is the most relevant issue with regards to character set. There are a couple other occurrences, with relation to script includes. Without some Cryillic data to test on I can't tell if that works. (If you can confirm it, I will push the change)

ghost commented 12 years ago

I changed:

/echelon/inc/header.php from 36 meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" to 36 meta http-equiv="Content-Type" content="text/html; charset=utf-8"

/echelon/lib/plugins/chatlogs/class.php from 310 $msg = cleanvar(removeColorCode($data['msg'])); to 310 $msg = removeColorCode($data['msg']);

After that, everything was displayed correctly http://s59.radikal.ru/i164/1111/96/535bd18898e5.jpg

WickedShell commented 12 years ago

I assume it fails without the removal of cleanvar in echelon/lib/plugins/chatlogs/class.php?

The cleanvar is there as anti-injection, and it's removal is not safe, but from looking at the documentation on some of the functions used in there (htmlentities specifically) it appears that that function also needs a charset. I will try and add an option to switch between multiple character sets so that the code will do the conversion for you, because you do want cleanvar() in there.

ghost commented 12 years ago

Here's how it was in the original: $msg = cleanvar(removeColorCode($data['msg'])); http://s017.radikal.ru/i433/1111/eb/0c3c22dbfa9b.jpg

after changing: $msg = removeColorCode($data['msg']); http://s017.radikal.ru/i432/1111/96/b788e715ca62.jpg

Leden4ik commented 11 years ago

all as set above. does not work http://s45.radikal.ru/i109/1210/53/d5f1eebbd6e8.png http://s47.radikal.ru/i116/1210/97/1a43ba804ed0.png

Debian

Leden4ik commented 11 years ago

all as set above. does not work http://s45.radikal.ru/i109/1210/53/d5f1eebbd6e8.png http://s47.radikal.ru/i116/1210/97/1a43ba804ed0.png

Debian

f1nik commented 11 years ago

@Leden4ik Замени в файле echelon/lib/plugins/chatlogs/class.php $msg = cleanvar(removeColorCode($data['msg'])); на $msg = removeColorCode($data['msg']);

и в файле echelon/inc/header.php meta http-equiv="Content-Type" content="text/html; charset="<?php echo $charset;?>" / на meta http-equiv="Content-Type" content="text/html; charset=utf-8" / (знаки больше-меньше убрал, т.к. не правильно отображались)

После этого всё должно работать.

ПС: аналогично, убрав cleanvar, можно поступить и здесь - http://www.banbutton.com/index.php/alternative-chatlog-page-for-echelon/

Leden4ik commented 11 years ago

В общем проблема с кирилицой все равно атуальна, все прописано как есть, но вместо русского вечно вопросительные знаки

Leden4ik commented 11 years ago

И да проблема не со стороны чата, а вообщем по всему сайту меняя названия на русское значения, то где бы то не было отображение идет вопросами

f1nik commented 11 years ago

Ну у меня ж работает http://s017.radikal.ru/i440/1302/b2/c824db568996.jpg

Leden4ik commented 11 years ago

Нет вы не поняли, так у меня по всему сайту, к примеру отредактировав в базе группы, и обозначив их русскими символами, все равно идет выдача вопросиков и именно только с echelon, так как отображение других сайтов на данной тачке нормальное.

Хочу спросить вас, у вас база в какой кодировке?

Ибо не понятно, почему такой вывод =(

f1nik commented 11 years ago

В основном кодировка - utf8_general_ci Название групп эшелона, если переименовать, у меня отображаются корректно. Или о каких группах речь?

Socolino commented 6 years ago

Подскажите пожалуйста!!! Почему у меня такие закорячки в базе данных óõ òû ëèâåíü в базе данных кодировка utf8 Сайт отображается без проблем по умолчанию кодировка utf8, а всё равно óõ òû ëèâåíü такие вот закорячки в логах чата , база данных Mysql помоги пожалуйста ?