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
It is not clear what encoding is used for C strings in the API. Are they ASCII, latin-1, or utf-8?
Either make this clear in the docs (maybe it is, but my cursory inspection didn't find it), or better still in the API itself.
A simple typedef would suffice.
typedefconstchar*Utf8String;
This would also make it clearer what is text data, and what is just bytes.
In HPyBytes_FromStringAndSize(HPyContext *ctx, const char *v, HPy_ssize_t len), v is just an array of bytes,
but in HPyImport_ImportModule(HPyContext *ctx, const char *name)name is a name.
The name gives a clue, but the encoding is hidden. HPyImport_ImportModule(HPyContext *ctx, Utf8String name) is much clearer.
The text was updated successfully, but these errors were encountered:
It is not clear what encoding is used for C strings in the API. Are they ASCII, latin-1, or utf-8?
Either make this clear in the docs (maybe it is, but my cursory inspection didn't find it), or better still in the API itself.
A simple typedef would suffice.
This would also make it clearer what is text data, and what is just bytes.
In
HPyBytes_FromStringAndSize(HPyContext *ctx, const char *v, HPy_ssize_t len)
,v
is just an array of bytes,but in
HPyImport_ImportModule(HPyContext *ctx, const char *name)
name
is a name.The name gives a clue, but the encoding is hidden.
HPyImport_ImportModule(HPyContext *ctx, Utf8String name)
is much clearer.The text was updated successfully, but these errors were encountered: