Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module URL::Encode has misleading function name url_encode_utf8 #6

Open
pali opened this issue Oct 19, 2018 · 1 comment
Open

Module URL::Encode has misleading function name url_encode_utf8 #6

pali opened this issue Oct 19, 2018 · 1 comment

Comments

@pali
Copy link

pali commented Oct 19, 2018

Function url_encode_utf8 has utf8 in its name and indicates that it is working with UTF-8 (bytes). Also in documentation is written:

Returns a URL-encoded representation of $string in UTF-8 encoding as an octet string.

But in reality this function expects on its input Unicode $string and not input encoded in UTF-8.

Unicode string is a sequence of ordinals, where each represent one Unicode code point. On the other hand UTF-8 encoded input means sequence of bytes (0...255) and one Unicode code point is represented by one to up to 4 bytes.

So the function name and also in description is misleading.

@Grinnz
Copy link
Collaborator

Grinnz commented Oct 19, 2018

I'm not sure what's misleading. The output is a UTF-8 encoded byte string as the documentation says. The utf8 refers to encoding the input to UTF-8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants