Skip to content

Unify ByteString/String conversions naming and read/write String methods naming from the core module #155

@fzhinkin

Description

@fzhinkin

Currently, we use ByteString.decodeToString and String.encodeToByteString as names for conversion methods between String and ByteString, where non-parameterized functions convert to/from UTF-8, and JVM-specific extensions accept Charset.
At the same time, the core module uses different naming for methods reading/writing UTF-8 string and methods reading/writing strings using specific Charset:

  • Source.readUtf8/Sink.writeUtf8 to work with UTF-8 strings
  • Source.readString/Sink.writeString to work with strings using the given Charset on JVM.

The naming is inconsistent and it seems reasonable to unify read/write methods naming with what we have for ByteString.
We can use readString/writeString w/o charset for UTF-8 strings (as these are treated as default in the library) and same-titled JVM-specific extensions accepting a Charset.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions