Add EUC-KR encoding for Korean#207
Conversation
bogdanfinn
left a comment
There was a problem hiding this comment.
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.
you need to set the finalResponse here or am i wrong?
There was a problem hiding this comment.
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.
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.
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.
@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.
@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