Comments (8)
Actually I removed ENT_HTML5 on the diff patch because this fails on PHP < 5.4, so here is the static method :
private static function _htmlentities($input) {
return htmlentities($input, ENT_NOQUOTES, 'UTF-8');
}
from php-finediff.
See this https://github.com/xrstf/PHP-FineDiff
I used it for Farsi/Persian language and it works perfectly.
from php-finediff.
Was this merged into the core?
from php-finediff.
@fr-freelance can you upload patch again?
from php-finediff.
There is a PR here, you could try to patch it manually. I just don't maintain this project anymore, and the purpose was to have efficient diff for ASCII-based text using PHP -- so that PR would defeat the primary purpose of the project, hence I never merged it.
from php-finediff.
Here is the download link.
@FractalizeR
@baceto90
from php-finediff.
The example on that page: http://www.raymondhill.net/finediff/viewdiff-ex.php work perfect for me with Latin and Cyrillic symbols. I follow the instructions for usage, but only work with Latin symbols. When i try to diff strings with Cyrillic, here is the result:
I wonder why the code does not work for me...
from php-finediff.
@baceto90 it works this way ok for cyrillic
$origEnc = 'UTF-8';
$enc = 'HTML-ENTITIES';
$oldValue = mb_convert_encoding($oldValue, $enc, $origEnc);
$newValue = mb_convert_encoding($newValue, $enc, $origEnc);
$diff = new FineDiff($oldValue, $newValue, FineDiff::$paragraphGranularity);
echo html_entity_decode(mb_convert_encoding($diff->renderDiffToHTML(), $origEnc, $enc));
from php-finediff.
Related Issues (20)
- renderFromOpcodes should return Text HOT 2
- Incorrect double encoding of some special HTML characters HOT 2
- Reverse diff opcode HOT 2
- How to use finediff for chineese language? HOT 3
- Temporary link for sharing does not work HOT 2
- finediff is eating my words when showing the comparisons. HOT 14
- finediff destroys german Umlaute in html-result HOT 7
- UTF-8 Help HOT 7
- Opcode word
- Why if not connect sending «uncaught exception» and script die?
- Is it possible to use paragraphGranularity and wordGranularity together ?
- Breaks completely when dealing with html tags
- Provide installation via php Composer
- Mark stable release with v1.0 HOT 1
- Do not work proper for line with similar text inside HOT 2
- Doc , Docx and PDF support HOT 1
- Render cyrillic HOT 2
- This project stops? HOT 1
- Identical strings
- How to grab the deleted words (highlighted in red)?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-finediff.