MatMoore / MatMoore/string-inspector

Investigate potential issue with high code points

Open
#5 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue
Dominant language
Rust
Stars
3
Forks
0
PR merge metrics
No merged PRs in 30d

Description

The formatting code currently assumes that the byte representation in hex, with spaces between bytes (`format_bytes()`) is always longer than the unicode code point in hex (`format_character()`).

For example, for the character U+1f4a9 in UTF-8 we have f0 9f 92 a9 (a width of 12) which is longer than 1f4a9 (a width of 5).

This makes sense for single byte encodings and unicode encodings but I suspect there may be exceptions.

If so, a `DecodedCharacer`'s `width()` should be the larger of the two.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating format_bytes(), format_character(), and DecodedCharacer::width() in the Rust CLI. Check whether characters with high Unicode code points can make the formatted code-point width exceed the spaced UTF-8 byte width. Done means width uses the larger value when such an exception exists, with behavior confirmed for the U+1f4a9 example.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.