Re: PSA: You can use UTF8String from WebIDL

2020-01-21 Thread Marcos Caceres
On Monday, January 6, 2020 at 12:51:56 PM UTC+11, Emilio Cobos Álvarez wrote: > If you need UTF-8 inputs from WebIDL (for example if you are passing the > input to Rust), chances are you're doing an extra copy from JS. > > In bug 1449861 I've added an UTF8String so that you can convert a >

Re: PSA: You can use UTF8String from WebIDL

2020-01-21 Thread Boris Zbarsky
On 1/20/20 8:44 PM, Marcos Caceres wrote: Is there a proposal to add this to the WebIDL spec In the IDL spec, the USVString type is representation-agnostic: it's Unicode on the IDL side, and doesn't say whether you represent Unicode as UTF-16, UTF-8, UTF-7, UCS-32, or whatever. So it

Re: PSA: You can use UTF8String from WebIDL

2020-01-06 Thread Jan de Mooij
On Mon, Jan 6, 2020 at 2:51 AM Emilio Cobos Álvarez wrote: > If it's not, it could be optimized teaching JSStrings to store UTF-8 > instead of / on top of Latin1 or such, or returning more information > from the callee, but I don't know how easy would be the first (IIRC > we're out of JSString

Re: PSA: You can use UTF8String from WebIDL

2020-01-06 Thread Emilio Cobos Álvarez
On 1/6/20 11:12 AM, Jan de Mooij wrote: On Mon, Jan 6, 2020 at 2:51 AM Emilio Cobos Álvarez > wrote: If it's not, it could be optimized teaching JSStrings to store UTF-8 instead of / on top of Latin1 or such, or returning more information from the callee,

Re: PSA: You can use UTF8String from WebIDL

2020-01-06 Thread Bobby Holley
Thank you (and all the dependent authors) for working on this! String conversion overhead is so silly in theory yet so difficult to eliminate in practice. It's great to see us investing in the right architecture to enable these optimizations across the board. On Sun, Jan 5, 2020 at 5:51 PM Emilio