hashgraph / hashgraph/pbj

feat: UTF8 to string (fromUTF8)

Open
#922 0 comments 0 reactions 0 assignees Claimed by @ldintr View on GitHub
Performance
Dominant language
Java
Stars
44
Forks
15
Avg merge
1d 15h
Merged PRs (30d)
12

Description

Adds `fromUTF8`/`fromUTF8Tail` to `ProtoParserTools`, decoding raw UTF-8 bytes directly into a caller-supplied `char[]` (handling 1–4 byte sequences and surrogate pairs), returning `-1` on malformed input instead of throwing.

**Benefit:** groundwork for `PbjReader.readString` to avoid allocating an intermediate `String`/`CharBuffer` per read.

PR: hashgraph/pbj#906

Contributor guide

Open the contributing guide

Research direction

Start with ProtoParserTools and compare the proposed fromUTF8/fromUTF8Tail behavior with PR hashgraph/pbj#906. Check how PbjReader.readString could use the caller-supplied char[] path; done means valid 1–4-byte UTF-8 and surrogate pairs decode, while malformed input returns -1 without throwing.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.