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

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

Merged
merged 6 commits into from
Apr 2, 2021

Conversation

zero734kr
Copy link
Contributor

Closes #10

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

@zero734kr
Copy link
Contributor Author

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

Copy link
Member

@tbnritzdoge tbnritzdoge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the Korean Tests are removed this looks good to merge although we may want to incorporate a encoding type in buffer#toString like in PetitioResponse#text. I will invoke @Nytelife26 to see his opinion on that. Thanks for the PR :)

Copy link
Member

@tbnritzdoge tbnritzdoge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the Korean Tests are removed this looks good to merge although we may want to incorporate a encoding type in buffer#toString like in PetitioResponse#text. I will invoke @Nytelife26 to see his opinion on that. Thanks for the PR :)

Copy link
Member

@tbnritzdoge tbnritzdoge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the Korean Tests are removed this looks good to merge although we may want to incorporate a encoding type in buffer#toString like in PetitioResponse#text. I will invoke @Nytelife26 to see his opinion on that. Thanks for the PR :)

@tbnritzdoge
Copy link
Member

Apologies for spamming this, my internet was having issues.

@zero734kr
Copy link
Contributor Author

zero734kr commented Apr 1, 2021

@tbnritzdoge applied edits for change requests as you requested 👍

src/lib/PetitioResponse.ts Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Apr 1, 2021

Coverage Status

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

@Nytelife26
Copy link
Collaborator

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 Nytelife26 changed the title fix(PetitioResponse): fixed that non-alphabetic letters was being broken fix(PetitioResponse): support non-ascii json responses Apr 2, 2021
@Nytelife26
Copy link
Collaborator

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

@Nytelife26 Nytelife26 merged commit d8344e4 into helperdiscord:master Apr 2, 2021
github-actions bot pushed a commit that referenced this pull request Apr 7, 2021
# [1.2.0](v1.1.0...v1.2.0) (2021-04-07)

### Bug Fixes

* **PetitioResponse:** support non-ascii json responses ([#11](#11)) ([d8344e4](d8344e4))

### Features

* add support for stream ([c706801](c706801))
* add text encoding option & tests ([7f6f5c6](7f6f5c6))

### Performance Improvements

* remove spread operators and callback loops ([#12](#12)) ([3bf48cc](3bf48cc))
@github-actions
Copy link

github-actions bot commented Apr 7, 2021

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Nytelife26 pushed a commit that referenced this pull request Apr 7, 2021
# [1.2.0](v1.1.0...v1.2.0) (2021-04-07)

### Bug Fixes

* **PetitioResponse:** support non-ascii json responses ([#11](#11)) ([d8344e4](d8344e4))

### Features

* add support for stream ([c706801](c706801))
* add text encoding option & tests ([7f6f5c6](7f6f5c6))

### Performance Improvements

* remove spread operators and callback loops ([#12](#12)) ([3bf48cc](3bf48cc))
github-actions bot pushed a commit that referenced this pull request Apr 8, 2021
# [1.2.0](v1.1.0...v1.2.0) (2021-04-08)

### Bug Fixes

* **PetitioResponse:** support non-ascii json responses ([#11](#11)) ([d8344e4](d8344e4))

### Features

* add support for stream ([c706801](c706801))
* add text encoding option & tests ([7f6f5c6](7f6f5c6))

### Performance Improvements

* remove spread operators and callback loops ([#12](#12)) ([3bf48cc](3bf48cc))
github-actions bot pushed a commit that referenced this pull request Apr 13, 2021
# [1.2.0](v1.1.0...v1.2.0) (2021-04-13)

### Bug Fixes

* change build target for backwards compat ([#25](#25)) ([87cbbd3](87cbbd3))
* **ci:** make filepaths correct ([9299fc0](9299fc0))
* **PetitioResponse:** support non-ascii json responses ([#11](#11)) ([d8344e4](d8344e4))

### Features

* abort-controllers ([#23](#23)) ([1ad4a5d](1ad4a5d))
* add all http methods ([#17](#17)) ([f869666](f869666))
* **ci:** build on every commit ([443070b](443070b))
* add support for stream ([c706801](c706801))
* add text encoding option & tests ([7f6f5c6](7f6f5c6))

### Performance Improvements

* improve response buffer handling ([#20](#20)) ([26d84e2](26d84e2))
* optimize loops ([#24](#24)) ([01b8012](01b8012))
* remove spread operators and callback loops ([#12](#12)) ([3bf48cc](3bf48cc))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Non-alphabetical texts like korean get crashed
4 participants