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
A-EnhancementNew feature or requestC-BuiltinsPRs and Issues related to builtins/intrinsicsE-MediumMedium difficulty problemGood First IssueGood for newcomersHacktoberfestHacktoberfest 2025 - https://hacktoberfest.digitalocean.com
ECMASCript feature
We currently lack the implementation of some built-in global functions used for URI encoding/decoding. You can find these functions in the spec here.
In those links you can find example code that should work after this implementation.
Implementation tips
We should probably create a new module here for these functions. An example of a built-in global function implementation can be seen here.
code_point_at just represents the operation CodePointAt from the spec. But maybe we could rewrite it to be more idiomatic with descriptive enum returns instead of bools and u8s
A-EnhancementNew feature or requestC-BuiltinsPRs and Issues related to builtins/intrinsicsE-MediumMedium difficulty problemGood First IssueGood for newcomersHacktoberfestHacktoberfest 2025 - https://hacktoberfest.digitalocean.com
Activity
sidntrivedi commentedon Oct 24, 2020
Hey @Razican , I would like to work on it. Thanks :)
Razican commentedon Jan 11, 2021
Hi @sidntrivedi012 how is this going?
captain-yossarian commentedon Jan 22, 2021
I will be happy to take a look if @sidntrivedi012 don't mind
tofpie commentedon Jan 24, 2021
Go ahead @captain-yossarian
captain-yossarian commentedon Jan 25, 2021
@Razican @tofpie Should/Can I use this percent_encoding crrate ?
Razican commentedon Jan 26, 2021
Hi, yes, if it makes sense to use it, feel free :)
jedel1043 commentedon Sep 20, 2021
Unassigned the issue by @captain-yossarian's request. For anyone interested, feel free to ping us if you want to work on this😁
jtara1 commentedon Oct 1, 2021
I'll take a look at this, please assign to me.
jedel1043 commentedon Oct 1, 2021
@jtara1 I've asigned it to you. Let us know if you need some pointers to get started :)
jtara1 commentedon Oct 2, 2021
I got something working with that crate ^
but I'm trying to just follow their algo directly in the ecma spec now
What's the return values for this function? https://github.com/jtara1/boa/blob/8ba500a26afdad8e200c9990b375664b5c04a97a/boa/src/builtins/string/mod.rs#L36
e: looks like @joshwd36 implemented that, what do the return values of
(u32, u8, bool)represent forcode_point_atfunc?jedel1043 commentedon Oct 2, 2021
code_point_atjust represents the operationCodePointAtfrom the spec. But maybe we could rewrite it to be more idiomatic with descriptive enum returns instead ofbools andu8sjtara1 commentedon Oct 2, 2021
the spec answered my question with
thanks
jtara1 commentedon Oct 3, 2021
So far the hardest part of this is figuring out what the transformation algo (for singles & pairs) for code point -> utf-8 encoded byte(s) is. https://en.wikipedia.org/wiki/UTF-8 which actually seems like the most thorough explanation for this
I'm also checking the node.js implementation of this https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/deps/v8/src/strings/uri.cc#L279
and
e: my answer may lie here https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/deps/v8/src/strings/unicode-inl.h#L144 still sorting through things
joshwd36 commentedon Oct 3, 2021
Would it be worth looking into #736 again? It seems that the implementation will be pretty closely tied to the encoding
jedel1043 commentedon Oct 5, 2021
Yeah, maybe. We could reevaluate if there's a way to adapt our regex to consume UTF-16, then change the definition of
JsString.Add URI encoding and decoding functions (#2267)