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: unreadable characters appear When the value of local storage in Chrome is Chinese #256

Open
huayanqiaq opened this issue Nov 9, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@huayanqiaq
Copy link

Describe the bug
Use ./hack-browser-data -vv paste result here

Desktop (please complete the following information):

  • OS Name: win10
  • Browser Name:chrome
  • Browser Version:

Additional context
比如这段打印出来错误了
[91 123 34 115 112 109 34 58 34 97 50 54 103 56 46 49 49 54 57 51 57 51 56 34 44 34 116 105 116 108 101 34 58 34 16 48 239 191 189 93 113 92 239 191 189 239 191 189 12 239 191 189 7 78 239 191 189 110 121 114 239 191 189 126 17 48 239 191 189 93 113 92 239 191 189 239 191 189 12 239 191 189 7 78 239 191 189 110 121 114 239 191 189 126 239 191 189 84 76 114 48 239 191 189 78 60 104 32 45 32 63 239 191 189 204 145 239 191 189 93 239 191 189 93 34 44 34 117 114 108 34 58 34 104 116 116 112 115 58 47 47 116 97 105 122 104 111 117 46 49 54 56 56 46 99 111 109 47 115 104 111 112 47 109 47 104 117 111 47 98 45 66 48 67 68 67 57 66 68 67 56 66 56 67 57 69 48 67 68 70 50 68 52 66 52 67 67 68 56 66 67 66 54 46 104 116 109 108 34 125 44 123 34 115 112 109 34 58 34 97 50 54 103 56 46 104 117 111 95 100 101 116 97 105 108 95 50 48 49 56 34 44 34 116 105 116 108 101 34 58 34 50 48 50 51 239 191 189 101 54 239 191 189 239 191 189 93 113 92 7 78 239 191 189 110 216 154 113 92 239 191 189 78 239 191 189 239 191 189 54 239 191 189 209 145 113 92 239 191 189 239 191 189 12 239 191 189 239 191 189 126 54 239 191 189 14 102 77 82 121 114 239 191 189 126 5 110 239 191 189 239 191 189 239 191 189 87 60 121 239 191 189 118 239 191 189 115 39 239 191 189 95 63 239 191 189 204 145 239 191 189 93 239 191 189 93 126 98 39 239 191 189 94 121 104 86 34 44 34 117 114 108 34 58 34 104 116 116 112 115 58 47 47 116 97 105 122 104 111 117 46 49 54 56 56 46 99 111 109 47 115 104 111 112 47 109 47 104 117 111 47 100 101 116 97 105 108 45 53 54 57 57 52 54 51 57 48 50 57 54 46 104 116 109 108 63 115 112 109 61 97 50 54 103 56 46 49 49 54 57 51 57 51 56 46 49 57 57 56 55 52 52 54 51 48 46 49 46 49 97 57 53 55 52 56 51 103 50 55 119 66 121 34 125 93]

{false https://xstore.insights.1688.com TURBO_AUTO_GET_SPM [{"spm":"a26g8.11693938","title":"�0�]q\�� ��N�nyr��0�]q\�� ��N�nyr��TLr0�N<h - ?�̑�]�]","url":"https://taizhou.1688.com/shop/m/huo/b-B0CDC9BDC8B8C9E0CDF2D4B4CCD8BCB6.html"},{"spm":"a26g8.huo_detail_2018","title":"2023�e6��]q\�N�nؚq\�N��6�ёq\�� ��~6��fMRyr�~�n���W<y�v�s'�_?�̑�]�]~b'�^yhV","url":"https://taizhou.1688.com/shop/m/huo/detail-569946390296.html?spm=a26g8.11693938.1998744630.1.1a957483g27wBy"}]}

正确的解析出来应该是这样的
[{"spm":"a26g8.11693938","title":"【巴山雀舌万源特级】巴山雀舌万源特级品牌、价格 - 阿里巴巴","url":"https://taizhou.1688.com/shop/m/huo/b-B0CDC9BDC8B8C9E0CDF2D4B4CCD8BCB6.html"},{"spm":"a26g8.huo_detail_2018","title":"2023新茶巴山万源高山云雾茶金山雀舌绿茶明前特级清香型礼盒现货_阿里巴巴找货神器","url":"https://taizhou.1688.com/shop/m/huo/detail-569946390296.html?spm=a26g8.11693938.1998744630.1.1a957483g27wBy"}]

解析出来的东西没问题但是中文乱码

我知道大概是这里有问题 但是能力有限不知道怎么修复

所属文件localstorage.go
// TODO: support unicode charter
func (s *storage) fillValue(b []byte) {
value := bytes.Map(byteutil.OnSplitUTF8Func, b)
s.Value = string(value)
}
这个函数问题

@huayanqiaq huayanqiaq added the bug Something isn't working label Nov 9, 2023
@moonD4rk moonD4rk changed the title chrome浏览器local storage导出key value中文乱码问题 Fix: unreadable characters appear When the value of local storage in Chrome is Chinese Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant