linkedin / linkedin/goavro

textual format does not correctly decode unicode strings

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

Nobody has claimed this yet.

Dominant language
Go
Stars
1.1k
Forks
232
PR merge metrics
No merged PRs in 30d

Description

In JSON, the Unicode characters with code points 0x7f to 0xff can be encoded either as those characters directly, or with a Unicode escape sequence (e.g. `\u00ff`).

As such, JSON with either of these two alternatives should be treated the same by goavro.

Unfortunately, it does not do that.
This code demonstrates the issue: https://play.golang.org/p/FxpmTjfmI15

This issue means that it's not possible to take JSON that's been encoded with or round-tripped through a normal JSON encoder and decode it correctly with goavro.

For example, this means that Avro JSON data that's piped through the `jq` command can be corrupted:

```
% echo '"\u00ff"' | jq .
"ÿ"
```

Contributor guide

No contributing guide indexed for this repository

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 with the linked Go playground reproducer and inspect goavro's textual-format JSON decoding path. Compare input containing a literal character such as `ÿ` with the equivalent `\u00ff` escape, including JSON produced by `jq`. Done means both forms decode identically without corrupting the Unicode value.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.