Skip to content

phpspec/php-diff does not work correctly with utf-8 #3258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
morivitalii opened this issue Apr 26, 2014 · 8 comments
Closed

phpspec/php-diff does not work correctly with utf-8 #3258

morivitalii opened this issue Apr 26, 2014 · 8 comments
Assignees

Comments

@morivitalii
Copy link

for example, if a line has some russian vowels ("a", "о", "и", and and etc), then the $ diff->render($ renderer) returns an empty string. Can you adapt phpspec/php-diff to work with utf-8?

@samdark samdark self-assigned this Apr 26, 2014
@samdark samdark added this to the 2.0 RC milestone Apr 26, 2014
@samdark
Copy link
Member

samdark commented Apr 28, 2014

I can't reproduce it. Can you provide an example code?

@morivitalii
Copy link
Author

very strange behavior. for example
$renderer = new DiffRendererHtmlInline;
$diff = new \Diff(['оку'], ['оока']); or $diff = new \Diff(['око'], ['ока']);
return empty string. but $diff = new \Diff(['оку'], ['ока']); all ok. I do not know what the problem
I tested on PHP 5.4.22 and PHP 5.5.6. the same result.

@samdark
Copy link
Member

samdark commented Apr 29, 2014

Reproduced. I don't think it will be solved in any of sources we're using. Need to think about it...

@samdark samdark modified the milestones: 2.0 GA, 2.0 RC Apr 29, 2014
@samdark
Copy link
Member

samdark commented Apr 29, 2014

Since it's not critical I've set milestone to 2.1. If you have an idea how to fix it or want to try implementing diff properly let us know. Thanks!

@samdark samdark modified the milestones: 2.1, 2.0 GA Apr 29, 2014
@kmindi
Copy link
Contributor

kmindi commented Jul 24, 2014

@yoopy have/can you tested/test it with this (not merged) pull request for php-diff: phpspec/php-diff#5 ?

@samdark
Copy link
Member

samdark commented Sep 7, 2014

We can consider switching to https://github.com/yetanotherape/diff-match-patch

@cebe
Copy link
Member

cebe commented Apr 10, 2016

phpspec/php-diff#5 is merged now and contained in release 1.1.0. can we close this?

@yii-bot
Copy link

yii-bot commented Apr 10, 2016

Issue moved to yiisoft/yii2-gii#147

@yii-bot yii-bot closed this as completed Apr 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants