-
Couldn't load subscription status.
- Fork 1.4k
add ZTransducer#iso8859_1 #3920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| * This transducer uses the String constructor's behavior when handling malformed byte | ||
| * sequences. | ||
| */ | ||
| val iso8859_1: ZTransducer[Any, Nothing, Byte, String] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we call it iso8859_1Decode to be aligned with utf8Decode? And allow for a potential encoding transducer in the future.
| */ | ||
| val iso8859_1: ZTransducer[Any, Nothing, Byte, String] = | ||
| ZTransducer.fromPush { | ||
| case Some(is) => ZIO.succeedNow(Chunk.single(new String(is.toArray, "ISO-8859-1"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using java.nio.charset.StandardCharsets.ISO_8859_1 might save an allocation here
| * This transducer uses the String constructor's behavior when handling malformed byte | ||
| * sequences. | ||
| */ | ||
| val iso8859_1: ZTransducer[Any, Nothing, Byte, String] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the JVM the charset is referred to as 'ISO_8859_1', maybe we should add a _ after iso
2ab053c to
bd0c19a
Compare
|
Nice work Maxim, thank you! |
Part of #3865