Victor Stinner schrieb am 07.09.2018 um 14:39:
Le ven. 7 sept. 2018 à 14:25, Stefan Behnel a écrit :
That reminds me that the current C-API lacks a way to calculate the size of the character buffer in bytes. You have to use "length * kind", which really relies on internals then. There should be a macro for this.
I don't think that it's a good idea to provide such function, since the size of one character depends on the size of other characters in a string when using compact strings...
Yes, exactly. Users shouldn't have to compute the data size themselves. There should be a macro that returns it for a given Unicode string.