Comments (7)
I've replicated the behavior you describe with python2. That's because we treat the input as a sequence of bytes, and wrapping a unicode character in the middle of a byte doesn't work well.
With python3 we have a different problem, where text goes off the screen. That's because we expect all characters to be the same width and that we can fit $COLUMNS
of them on the screen at once.
from icdiff.
I've fixed the character width issue with 908af2f (1.2.2), where fullwidth characters were being treated as single width.
For now at least, icdiff works on bytes if run under python2 and utf8 characters if run under python3, so support for fullwidth characters is python3 only.
from icdiff.
Hi, @jeffkaufman , this issue not completely fixed.
I switch to python3 and used the same test case as I've provided. Indeed there is no breaking of Chinese characters now, but the text rendering is faulty. Chinese characters are double-width characters, and they should take the space of two ascii characters instead of one. when the current version of icdiff renders the diff output, it would be like(for a console width of 124 characters):
which is not desirable, for the content is not properly wrapped.
For the icdiff version, I'm using 1.3.1.
from icdiff.
I'm testing with:
CHARS='测试行abc测试测试行abc测试测试行abc测试测试行abc测试测试行abc测试测试行abc测试测试行abc测试测试行abc测试测试行abc测试'
icdiff <(echo "$CHARS") <(echo "$CHARS" | tr c d)
And you're right, this isn't working.
from icdiff.
Fixed in a9b26aa.
from icdiff.
great job, thanks.
from icdiff.
with 93cffff this should work on python2 as well
from icdiff.
Related Issues (20)
- update icdiff on pypi.org to latest version HOT 2
- ChangeLog does not mention versions newer than 1.9.4 HOT 1
- BUG: Filenames show as mismatch when using exclusions
- Bug report: configuration for `git icdiff` did not work HOT 2
- installing the latest release-2.0.0 requires different command than install instructions HOT 2
- icdiff doesn't work on windows HOT 2
- Add support to specify colors using RGB ? HOT 1
- Add Support for custom patch hunk headers (with some builtins) HOT 1
- It seems have some problem about utf-8 HOT 1
- git icdiff shows old filname for renamed files HOT 2
- Multi-version of the Python HOT 1
- Exit code 1 using process substitutions HOT 4
- Pip install with `--platform` showing ERROR HOT 2
- [issue] linux more shows empty line. ex) icdiff -N fileA fileB | more -60 HOT 1
- Config file HOT 1
- Feature Request: Add an option to output directories before the files (recursively) HOT 1
- icdiff hanging on large files HOT 5
- Not clear how to install icdiff HOT 2
- Publish wheels for icdiff HOT 3
- Questions about Copilot + Open Source Software Hierarchy HOT 2
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 icdiff.