gorhill / PHP-FineDiff

A PHP implementation of a Fine granularity Diff engine: Diff can be computed up to character-level

Home Page:http://www.raymondhill.net/finediff/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Render cyrillic

baceto90 opened this issue · comments

Hi guys,
its a great library, but i have problem with Rendering on cyrillic symbols.

$from_text = "Някаква кирилица";
$to_text = "Някаква кирилица, тест";

$from_text = mb_convert_encoding($from_text, 'HTML-ENTITIES', 'UTF-8');
$to_text = mb_convert_encoding($to_text, 'HTML-ENTITIES', 'UTF-8');

$diff_opcodes = FineDiff::getDiffOpcodes($from_text, $to_text, 2);
$rendered_diff = FineDiff::renderDiffToHTMLFromOpcodes($from_text, $diff_opcodes);

echo $rendered_diff

When i try to print $rendered_diff it shows me:
������� ��������, ����

� => &.#.2.0.1.3.2.6.5.9.3.3; (without points)
Whats wrong with it?

I tested here http://www.raymondhill.net/finediff/viewdiff-ex.php and works great...

It works on bytes, not on characters.

See #11.

Thanks for the replay. I saw this topic, but the downloading patch link is not available and i don't know how to integrated myself...