You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
what would you suggest though? is there a standard api for getting the encoding of a string? converting it to utf8? or maybe if it's not in the encoding of the rest of the array, we reject it?
AFAIK there's no API to get the encoding of a string, but that would be a logical complement to codeunit/codeunits. BTW, there's no guaranty that you can call pointer on an AbstractString and get a pointer to the data: one would need to use codeunits anyway even if the encoding matched.
Waiting for a better API, I guess the only solution is to have a fast method for String with StringArray{<:Union{Missing, String}}, and a slower method iterating over characters for other cases.
[comment generated via AI] Fixed on main by #102: setindex!, push! and insert! now store non-UTF-8 strings (e.g. WeakRefString{UInt16}) and pointerless AbstractStrings as UTF-8. Verified on main 8ebbbab with Julia 1.12; not yet in a release.
Activity
quinnj commentedon May 7, 2019
what would you suggest though? is there a standard api for getting the encoding of a string? converting it to utf8? or maybe if it's not in the encoding of the rest of the array, we reject it?
nalimilan commentedon May 8, 2019
AFAIK there's no API to get the encoding of a string, but that would be a logical complement to
codeunit/codeunits. BTW, there's no guaranty that you can callpointeron anAbstractStringand get a pointer to the data: one would need to usecodeunitsanyway even if the encoding matched.Waiting for a better API, I guess the only solution is to have a fast method for
StringwithStringArray{<:Union{Missing, String}}, and a slower method iterating over characters for other cases.quinnj commentedon Oct 15, 2026
[comment generated via AI] Fixed on main by #102: setindex!, push! and insert! now store non-UTF-8 strings (e.g. WeakRefString{UInt16}) and pointerless AbstractStrings as UTF-8. Verified on main 8ebbbab with Julia 1.12; not yet in a release.