Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

grep: -F -f rejects a pattern file that contains invalid UTF-8

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

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

Research direction

Start by locating the code that loads patterns for fixed-string mode (-F -f), then compare its byte handling with the behavior discussed in #64 and #75. Run the issue’s commands and check the exit status and output bytes; done means uutils exits 0 and writes ff 0a for the invalid-UTF-8 pattern and input.

Written by the indexing model from the issue text.

Description

bug

uutils decodes a pattern file as UTF-8 even when the patterns are fixed strings. GNU matches the bytes.

$ printf '\377\n' > patterns; printf '\377\n' > input
$ LC_ALL=C grep -aF -f patterns input > out.bin; status=$?
$ echo "status=$status"; od -An -tx1 out.bin

GNU grep 3.12 exits 0 and writes ff 0a. uutils reports grep: patterns: stream did not contain valid UTF-8, exits 2, and writes nothing. The result is the same with LC_ALL=C.UTF-8.

#64 and the closed #75 discuss byte and locale handling more generally.

Dominant language
Rust
Stars
133
Forks
25
Avg merge
19h 49m
Merged PRs (30d)
11

Getting set up

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.

More from uutils/grep

All issues in uutils/grep

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.