6 kyu
Utf-8: Binary Encoding
90 of 105chivery
Loading description...
Unicode
Strings
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
It would be better if basic tests included not only chars but strings too.
This comment has been hidden.
Not an issue, you've to explain the stuff properly.
This comment has been hidden.
the strings you posted are not equal. try to pinpoint the characters for which your solution fails instead of posting the whole thing here please >:(
JavaScript translation
Approved
thanks !
Return type of
toUTF8binary
is suggested as[]
, but should be""
.Is the encoding of the input UTF-16 ?!?
The tests ( and the example solution ) use experimental APIs that "should not be used in production code".
Trashy, do you not consider a kata production code? If so, we disagree. I think it's fine to use it for your example solution, but it seems asking for trouble to use it in testing.
Example tests are limited to single-UTF-16-character strings. Description just says "strings", and Submit testing indeed introduces multi-character strings. That's not the kind of surprise I like in testing.
I don't know if the Python original did it the same way. If it did, I'd suggest changing it in both. If it didn't, pay more attention before approving.
You have my downvote.
Love the username
UTF-16
as its character encoding in the descriptiontoUTF8binary
This comment has been hidden.
why do you post the whole thing here ? it's not of any use and it makes the page unreadable ... try to pinpoint the precise characters for which your solution differs from whats expected
Very instructive but way more difficult than a standard 6 Kyu Kata.
This was a really enjoyable kata.
utf8_to_binary converts from string to utf8
binary_to_utf8 converts from utf8 to string
Strange names...
Thanks for the feedback, adjusted the names.
My solution passes all tests (including random tests), except for the very first one. Could you verify its correctness, please?
The first test case is correct, your cases when < 128 have an incorrect bitlength.
My bad, thank you! Nice kata, by the way :-)
Thank you! :D