Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

finediff destroys german Umlaute in html-result #21

Closed
aaronnottbeck opened this issue Mar 5, 2015 · 7 comments
Closed

finediff destroys german Umlaute in html-result #21

aaronnottbeck opened this issue Mar 5, 2015 · 7 comments

Comments

@aaronnottbeck
Copy link

I like your diff tool very much and most times it works fine for me.
If i try to diff a text with german Umlaute the result is not that nice.
Your tool recognize the changes but the result shows the Umlaute as html decoded.
Ü is shown as Ü and so on.

@gorhill
Copy link
Owner

gorhill commented Mar 5, 2015

FineDiff wasn't meant for display purpose. But I had started work to fix the general "display diff with Unicode characters" problem with FineDiff, but didn't find time to work more on this. Dup of #20.

@gorhill gorhill closed this as completed Mar 5, 2015
@aaronnottbeck
Copy link
Author

this has nothing to do with unicode. imo you're using htmlentities in a wrong way. i fixed it for me.

@gorhill gorhill reopened this Mar 5, 2015
@gorhill
Copy link
Owner

gorhill commented Mar 5, 2015

Can you share? I had assumed it was the recurring Unicode issue with FineDiff, as it knows only about binary strings, not Unicode characters.

@aaronnottbeck
Copy link
Author

i am not sure if my change is generally correct - i just removed htmlentities function in the html renderer:
https://github.com/aaronnottbeck/PHP-FineDiff
for me it works.

@gorhill
Copy link
Owner

gorhill commented Mar 5, 2015

Ok I see. I had changes related to #20, which are not checked-in. You are right that htmlentities is not the right thing to use, but not escaping at all is not the right thing either. My local changes replaced htmlentities with htmlspecialchars. These changes have been live on my server for a while now (though not reflected in the github repo), so if you still have problem with the online tool, it's again the recurring issue that FineDiff is unaware of Unicode characters.

@aaronnottbeck
Copy link
Author

as i wrote. i fixed it for me - thanks for answering.

@gorhill
Copy link
Owner

gorhill commented Mar 5, 2015

You are going to have problem if there are special chars in the output, such as <, >, etc. This can easily lead to security issue if the output is used as is on a server.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants