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

Multibyte-character output misalignment with tags #322

Closed
vladdeSV opened this issue Aug 1, 2024 · 1 comment · Fixed by #324
Closed

Multibyte-character output misalignment with tags #322

vladdeSV opened this issue Aug 1, 2024 · 1 comment · Fixed by #324
Labels
BUG Something isn’t working

Comments

@vladdeSV
Copy link
Contributor

vladdeSV commented Aug 1, 2024

If my tag include a multibyte character, when using the command klog tags, the tags are not aligned properly.

Assumme we have the file test.klg:

2024-08-01
  1h #a
  1h #b
  1h #ß

Running klog tags test.klg will produce the output:

#a  1h
#b  1h
#ß 1h

Here we can see that #a and #b are aligned, but row with the ß is missing a spacing character.

If instead of using a ß (two bytes) we use 𒀀 (four bytes) we get this output:

#a    1h
#b    1h
#𒀀 1h
Finally, we can have a little fun with this

This file:

2024-08-01
  1h #ö
  1h #öö
  1h #ööö
  1h #öööö
  1h #ööööö
  1h #öööööö

… produces this output:

#ö           1h
#öö         1h
#ööö       1h
#öööö     1h
#ööööö   1h
#öööööö 1h
@vladdeSV vladdeSV added the BUG Something isn’t working label Aug 1, 2024
@jotaen jotaen closed this as completed in 3ade1d8 Aug 2, 2024
@jotaen
Copy link
Owner

jotaen commented Aug 2, 2024

Ah, thanks for reporting this! So far, the underlying table implementation just did a naive byte count, which of course yields incorrect results for multibyte Unicode strings. #324 fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Something isn’t working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants