-
-
Notifications
You must be signed in to change notification settings - Fork 242
Add EUC-KR encoding for Korean #207
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
base: master
Are you sure you want to change the base?
Conversation
bogdanfinn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution. really appreciate it.
I left some comments for minor improvements.
|
|
||
| c.logger.Debug("response body payload: %s", finalResponse) | ||
|
|
||
| resp.Body = responseBody |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to set the finalResponse here or am i wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a log to check if it's encoded normally
| c.logger.Debug("response body payload: %s", string(buf)) | ||
| finalResponse := string(buf) | ||
|
|
||
| if c.config.euckrResponse { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your korean encoding transformation is only happening in debug here (check line 383)
I think what you want is to do it always and transform the resp.Body if the option for euckr response is enabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right, actually I'm using the client in typescript, and the library is already encoding and transferring body values normally
I'm not used to golang because I don't use it professionally
As you said, if the euckr option is enabled, it should always be reflected in the result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahnse0 do you have an example url which i can use for testing your change if everything works?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bogdanfinn Of course, https://helinox.co.kr
It is made for Koreans.
The characters are normally represented on websites that use euc-kr instead of the default utf-8