HaxeFoundation / HaxeFoundation/haxe

Should Bytes.toString really use getString?

Open
#7,904 2 comments 4 reactions 0 assignees View on GitHub
discussion
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

I know it has been like this for a while, but having an implicit conversion like this seems wrong to me. In the general case, the conversion does not lead to printable strings and printing is what `toString` is typically used for. There could be 0-chars in the middle which in the standard `getString` implementation truncate the string.

IMO the user should be explicit about such a conversion. A `toString` could act more like `toHex` instead.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.