blibli-badak / selenium-har-util

Apache License 2.0
26 stars 8 forks source link

it seems only support english response? #51

Closed qdyzw closed 4 months ago

qdyzw commented 5 months ago
                  "CodeVerGroup": "pk202403",
                   "Desc": "部署策略,控制机器人踢足球,进行5V5的精彩对决",

i drop the har file to chrome dev tool,then i see some response data become mojibake , it only support english response data?

MHabiib commented 5 months ago

hi @qdyzw thank you for using our open source util, for the above issue may i know what language that used for the "Desc"?

qdyzw commented 5 months ago

hi @qdyzw thank you for using our open source util, for the above issue may i know what language that used for the "Desc"?

hi,language is simplified Chinese. and you create a very useful tool

argotri commented 5 months ago

hi @qdyzw may i know the sample of website that we can use ? might be there are some unicode issue in the util

qdyzw commented 5 months ago

hi @qdyzw may i know the sample of website that we can use ? might be there are some unicode issue in the util

hello,you can use selenium to open website "https://api.vvhan.com/hotlist.html" ,then check the message field.

the normal data: { "success": false, "code": 88888, "message": "接口路径不存在 请前往 https://api.vvhan.com/ 查看免费API接口列表" }

our har util data: { "success": false, "code": 88888, "message": "接口路径不存在 请前往 https://api.vvhan.com/ 查看免费API接口列表" }

MHabiib commented 5 months ago

Hi @qdyzw,

Could you attach the HAR file? When I try this on my local setup, the issue is not occurring.

image

I used https://toolbox.googleapps.com/apps/har_analyzer/, and it shows the following:

image

The response includes Unicode escape sequences.

qdyzw commented 5 months ago

Hi @qdyzw,

Could you attach the HAR file? When I try this on my local setup, the issue is not occurring.

image I used https://toolbox.googleapps.com/apps/har_analyzer/, and it shows the following: image The response includes Unicode escape sequences.

ok ttt.zip

MHabiib commented 5 months ago

Hi @qdyzw,

Thanks for attaching the HAR file. From my review, there doesn't seem to be an issue on the HAR side. The problem might be on your side while decoding the Unicode to Simplified Chinese. Here is a sample code snippet if you are using Java:

String decodedStr = new String(originalStr.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8);

qdyzw commented 5 months ago

Hi @qdyzw,

Thanks for attaching the HAR file. From my review, there doesn't seem to be an issue on the HAR side. The problem might be on your side while decoding the Unicode to Simplified Chinese. Here is a sample code snippet if you are using Java:

String decodedStr = new String(originalStr.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8);

image i copy this unicode to ask gpt,gpt can decode the right language


but if i just drop the file to chrome or firefox ,it just become mojibake,then i find some website to decode that unicode,it become mojibake too,it confuse me..... image

anyway,thank you !

argotri commented 5 months ago

able to reproduce and already found the solution, there will be added support for setting up charset in the next release ( 1.3.0 ) waiting for review the code

argotri commented 4 months ago

https://github.com/blibli-badak/selenium-har-util/releases/tag/1.3.0 done, released , sorry for long time , because i just came back from my vacation