GordonSmith opened issue #6719:
Feature
I am trying to implement the "load_string_from_range" ABI function in c++:
def load_string_from_range(cx, ptr, tagged_code_units): match cx.opts.string_encoding: case 'utf8': ... case 'utf16': ... case 'latin1+utf16': ... return (s, cx.opts.string_encoding, tagged_code_units)
But have been unable to locate anything relating to cx.opts.string_encoding in the c/c++ headers
Benefit
Avoid potential issues dealing with strings
Implementation
Alternatives
Assume string type is "utf8"?
alexcrichton commented on issue #6719:
Thanks for the report, but the component model is not supported in the C API yet. So in that sense it's expected that the string encoding isn't availble.
It's worth pointing out though that this string encoding isn't even available in the Rust API, though. This is an internal implementation detail of components which embedders shouldn't in theory need to know about (other than optimizing perhaps)
GordonSmith commented on issue #6719:
Thanks for the update - also if the "tagged_code_units" is meant to represent the string length (and not the buffer length - then the python utf8 case looks wrong to my eye (or is that a question for the spec repo)?
GordonSmith edited a comment on issue #6719:
Thanks for the update - also if the "tagged_code_units" is meant to represent the string length (and not the buffer length) - then the python utf8 case looks wrong to my eye (or is that a question for the spec repo)?
alexcrichton commented on issue #6719:
I think that's a question/issue for the spec repo
GordonSmith commented on issue #6719:
Thx... closing.
GordonSmith closed issue #6719:
Feature
I am trying to implement the "load_string_from_range" ABI function in c++:
def load_string_from_range(cx, ptr, tagged_code_units): match cx.opts.string_encoding: case 'utf8': ... case 'utf16': ... case 'latin1+utf16': ... return (s, cx.opts.string_encoding, tagged_code_units)
But have been unable to locate anything relating to cx.opts.string_encoding in the c/c++ headers
Benefit
Avoid potential issues dealing with strings
Implementation
Alternatives
Assume string type is "utf8"?
Last updated: Dec 23 2024 at 12:05 UTC