Zinc-Character-Encoding Updates

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Zinc-Character-Encoding Updates

Sven Van Caekenberghe-2
Although Zinc HTTP Components is a framework for HTTP with full featured client and server implementations, it has long contained two sub packages that are independent of HTTP or even networking: Zinc-Resource-Meta (which implements URL and MimeType) and Zinc-Character-Encoding (for all kinds of character encoding).

While implementing the Pharo Unicode project, I made a couple of changes to Zinc-Character-Encoding.

The ZnCharacterEncoder hierarchy was refactored a bit with the introduction of ZnUTFEncoder and ZnEndianSensitiveUTFEncoder while a new encoder was added: ZnUTF32Encoder.

This means all official Unicode encoders, UTF-8, UTF-16 and UTF-32 are now supported. See the chapters '3.9 Unicode Encoding Forms' and '3.10 Unicode Encoding Schemes' in http://www.unicode.org/versions/Unicode8.0.0/ch03.pdf 

The API of the encoders was also extended to not only work between characters and bytes, but also between integer Unicode code points and bytes.

A refactoring was done regarding streams as well with the introduction of ZnEncodedStream and ZnEncoded[Read|Write]Stream above ZnCharacter[Read|Write]Stream and the addition of ZnCodePoint[Read|Write]Stream.

Summary: some new features, all public API remains the same.

Sven