helperdiscord / petitio

An HTTP/S library designed to be simple, fast, and type-strong.
https://helperdiscord.github.io/petitio/
MIT License
44 stars 6 forks source link

fix(PetitioResponse): support non-ascii json responses #11

Closed zero734kr closed 3 years ago

zero734kr commented 3 years ago

Closes #10

Using Buffer#toString fixed this because it parses string to utf-8 automatically.

zero734kr commented 3 years ago

Ah, no problem if you prefer to delete the tests/checkKorean.test.ts file because I used it only to test if it was really working

tbnritzdoge commented 3 years ago

Apologies for spamming this, my internet was having issues.

zero734kr commented 3 years ago

@tbnritzdoge applied edits for change requests as you requested 👍

coveralls commented 3 years ago

Coverage Status

Coverage increased (+0.003%) to 98.633% when pulling f5c22f45e8f1a60b702183cfcec6cf3174a6388d on zero734kr:patch-1 into d91ed7fedea87eb25a0db50ebca767c6a3ec0225 on helperdiscord:master.

Nytelife26 commented 3 years ago

The reason we didn't use toString or the like it is because it is approximately 3x slower according to our testing. I will look into ways to rectify this now, perhaps if there is a way to use fromCharCode with string encoding. Thank you for the PR!

Nytelife26 commented 3 years ago

Nevermind, looks good to me. Ready to merge once CI passes.

github-actions[bot] commented 3 years ago

:tada: This PR is included in version 1.2.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: