nushell / nushell/nushell

Parse bom in UTF-8 .nu files

Open
#16,491 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A:parser category:enhancement status:needs-triage
Dominant language
Rust
Stars
40.5k
Forks
2.3k
Avg merge
1d 14h
Merged PRs (30d)
79

Description

Related problem

I was struggling to use import a nushell .nu file, getting weird closure_848 error messages until I realized by trying to copy the content of the file to another one that worked that the only difference is the original had a UTF-8 with BOM encoding

Describe the solution you'd like

The file works as BOM is a valid variant of UTF8 (as much as the whole BOM might be annoying)

Describe alternatives you've considered

Converting files to use a BOM-less variant, but given there is not good error message it's tough to rely on being aware of this tiny thing

Additional context and details

There is this closed https://github.com/nushell/nushell/issues/164 issue that seems to be about BOM support, but think it only dealt with utf-16?

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 reproducing the use import failure with a UTF-8 BOM-prefixed .nu file, then trace Nushell's .nu parsing and decoding path. Review the related issue 164 and add coverage for the reported case; done means BOM-prefixed files import successfully like BOM-less files.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, shell
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.