-
Notifications
You must be signed in to change notification settings - Fork 66
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
Indexing StdString
returns Int8
which breaks most basic string functions
#363
Comments
I think the best way to fix this is to change |
I would agree that returning a non- I should mention that there is ways to work with UTF-8 in C/C++. A familiar person wrote an article about it, but it is still quite a lot of work to correctly support IMO, simply returning a |
Issue Indexing `StdString` returns `Int8` which breaks most basic string functions #363
Related to issue JuliaInterop/CxxWrap.jl#363
I think this is actually fixable, at least the examples shown above pass with the two commits mentioned above. It is unfortunate that at the |
Related to issue JuliaInterop/CxxWrap.jl#363
Issue Indexing `StdString` returns `Int8` which breaks most basic string functions #363
When indexing a
StdString
, aInt8
is returned, which is different from the indexing ofBase.String
, which returns aChar
.However, as mentioned in the
AbstractString
documentation, indexing a string should return anAbstractChar
.Therefore most functions operating on strings are broken:
I find this quite confusing, since
StdString <: AbstractString
, Julia happily treatscxx_s
as a string yet fails to do any operations on it. Printing gives the correct string representation,==
works as expected, but all else breaks.Furthermore, UTF-8 characters completly break
StdString
:The text was updated successfully, but these errors were encountered: