Skip to content
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

Convert first, *then* trim! #86

Closed
SamB opened this issue Sep 7, 2012 · 1 comment
Closed

Convert first, *then* trim! #86

SamB opened this issue Sep 7, 2012 · 1 comment

Comments

@SamB
Copy link
Contributor

SamB commented Sep 7, 2012

In draw_chars(), you first trim the input to the desired width and then transliterate it to the output encoding. This causes things to get out of alignment, try:

$ LANG=C ./tig 2324d6120c5de58f63b32b876bd33e99d7375dbb

to see what I mean.

@jonas jonas closed this as completed in 742ad98 Aug 5, 2013
@ashumkin
Copy link

742ad98

This fix breaks the case, for example, when commit message has non-ASCII characters and LC_ALL set to non-UTF-8 encoding (cp1251 in my case)

len = utf8_length(&string...)
as we can see, string is assumed to be UTF-8 string , but after encoding_iconv() it is not! And len in a result is much less then actual string length.
So, non-UTF-8 string is cut and git log looks corrupted.

P.S. And did't get what @SamB meant

try:
$ LANG=C ./tig 2324d61
to see what I mean.

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

2 participants