mkitti / StaticStrings.jl

Fixed-length strings in Julia represented by NTuples
MIT License
13 stars 2 forks source link

Support UTF-16 or UTF-32 #8

Open mkitti opened 2 years ago

mkitti commented 2 years ago

Currently StaticStrings.jl supports UTF-8 only.

We could support UTF-16 or UTF-132 as in https://github.com/JuliaStrings/LegacyStrings.jl

mkitti commented 1 year ago

See the transcode function. For example transcode(UInt16, x) for UTF-16 or transcode(UInt32, x) for UTF-32.

mkitti commented 1 year ago

My current thought is to add a type parameter. The default type will be UInt8. Unlike in PythonCall.jl, The parameter order will be StaticString{N,T}, the same order as NTuple{N,T}. We would then try to follow the legacy strings pattern, but mostly just provide facilities for storing the type and using transcode to conver between the types.