https://github.com/juliastrings/legacystrings.jl
Legacy Unicode string types
https://github.com/juliastrings/legacystrings.jl
ascii julia strings unicode utf-16 utf-32
Last synced: about 1 year ago
JSON representation
Legacy Unicode string types
- Host: GitHub
- URL: https://github.com/juliastrings/legacystrings.jl
- Owner: JuliaStrings
- License: other
- Created: 2016-06-29T00:32:03.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2023-05-03T16:39:13.000Z (about 3 years ago)
- Last Synced: 2025-04-12T20:04:03.500Z (about 1 year ago)
- Topics: ascii, julia, strings, unicode, utf-16, utf-32
- Language: Julia
- Size: 93.8 KB
- Stars: 13
- Watchers: 6
- Forks: 18
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# LegacyStrings
[](https://github.com/JuliaStrings/LegacyStrings.jl/actions?query=workflow%3ACI)
The LegacyStrings package provides compatibility string types from Julia 0.5 (and earlier), which were removed in subsequent versions, including:
- `ASCIIString`: a single-byte-per character string type that can only hold ASCII string data.
- `UTF8String`: a string type with single byte code units (`UInt8`), encoding strings as UTF-8.
- `UTF16String`: a string type with two-byte native-endian code units (`UInt16`), encoding strings as UTF-16.
- `UTF32String`: a string type with four-byte native-endian code units (`UInt32`), encoding strings as UTF-32.
- `ByteString`: a type alias for `Union{ASCIIString,UTF8String}`, i.e. strings that can be passed to C directly.
- `WString`: an alias for `UTF16String` if `Cwchart_t` is two bytes (i.e. Windows) or `UTF32String` otherwise.
- `RepString`: a string type for efficient handling of repeated strings.
LegacyStrings also defines and exports converter functions for these types, i.e.:
- `ascii`: convert to `ASCIIString`; since `Base` exports an `ascii` function as well, you must explicitly do `import LegacyStrings: ascii` or write `LegacyStrings.ascii` in order to use this function rather than `Base.ascii`.
- `utf8`: convert to `UTF8String`.
- `utf16`: convert to `UTF16String`.
- `utf32`: convert to `UTF32String`.
- `wstring`: alias for `utf16` or `utf32` according to what `WString` is an alias to.