rev: multibyte characters are reversed byte by byte in UTF-8 locales

Offen
#656 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@SichenLiang arbeitet bereits daran.

Seit 06.10.2026.

  • #657 von @SichenLiang — offen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
65/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
rust
Bereich
cli

Rechercherichtung

Start by locating the rev command implementation and its tests, then run the UTF-8 reproduction from the issue with LC_ALL=C.UTF-8. Compare its output with the stated util-linux behavior, including the combining mark. Done means reversing Unicode code points rather than the bytes within multibyte characters.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

uutils rev reverses each line byte by byte even in a UTF-8 locale. This reverses the bytes inside every multibyte character and produces invalid UTF-8. util-linux 2.42.4 reverses the order of code points instead.

Set UTIL_LINUX_REV to the absolute path to the rev binary from util-linux 2.42.4.

printf 'aé中🙂b\ne\314\201x\n' | LC_ALL=C.UTF-8 "$UTIL_LINUX_REV"

util-linux prints b🙂中éa, followed by x, U+0301, and e. uutils reverses the bytes inside é, 中, 🙂, and the combining mark.

Vorherrschende Sprache
Rust
Sterne
230
Forks
62
Ø Merge
1 T. 2 Std.
Gemergte PRs (30 T.)
23

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus uutils/util-linux

Alle Issues in uutils/util-linux

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.