dump is not escaping non-printable characters
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 597
- Forks
- 223
- Avg merge
- 11h 23m
- Merged PRs (30d)
- 3
Description
I have some YAML with some values containing non-breaking spaces, correctly formatted according to the YAML spec's guidelines on escaped characters as "\_". Psych correctly loads these strings and converts them to non-breaking space characters (\u00A0). The issue is that when dumping back to YAML, Psych does not correctly escape these non-printable characters as specified by the spec.
Example
Expected
irb(main):002:0> Psych.dump(Psych.load('"\\_"'))
=> "--- \"\\_\"\n"
Actual
irb(main):002:0> Psych.dump(Psych.load('"\\_"'))
=> "--- \" \"\n"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no source file or test. Start with the Psych.load/Psych.dump reproduction shown here and trace the dumping path for the non-breaking space; done means the round trip emits the YAML escape "\_" instead of a literal non-breaking space.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100