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

Characters get garbled or even no notification when contains Chinese or Japanese. #18

Open
myzWILLmake opened this issue Jul 26, 2019 · 3 comments

Comments

@myzWILLmake
Copy link

I tested the code and the case one by one, and got this result:

func main (){
  notification := toast.Notification{
    Title: "1_Title", 
    // 2_Title
    // 3_Title
    // 4_Title
    // 5_标题 
    Message: "msg test",
    // msg 测试
    // msg テスト
    // 测试
    // msg test
  }
  notification.Push()
}

garbled-notification

Notifications 2,4,5 got garbled, and Notification 3 is not be notified.
Message 2,4 have Chinese characters. Message 3 has Japanese characters.
Title 5 have Chinese characters.

The version of Windows 10 is 18362.239.

@user12138
Copy link

same issue from 17763.379

@yst726
Copy link

yst726 commented Sep 18, 2019

我也遇到这个问题,找了好久,
原因是windows的utf8是带bom, go生成的文件没有bom,导致乱码,
解决方案是修改toast.go文件的343行(方法invokeTemporaryScript)下添加一行content = "\uFEFF" + content
这句话的意思是在生成的文件之前添加bom标识,这样就可以了

I had the same problem. I searched for it for a long time.
The reason is that utf8 of Windows is with bom, and the file generated by go has no bom, resulting in garbled codes.
The solution is to modify the toast. Go file by adding a line 'content = "\uFEFF" + content' under line 343 (method invokeTemporaryScript)
This sentence means to add the bom identification before the generated file, so that it is ok

@yxzlwz
Copy link

yxzlwz commented Nov 7, 2021

我也遇到这个问题,找了好久, 原因是windows的utf8是带bom, go生成的文件没有bom,导致乱码, 解决方案是修改toast.go文件的343行(方法invokeTemporaryScript)下添加一行content = "\uFEFF" + content 这句话的意思是在生成的文件之前添加bom标识,这样就可以了

I had the same problem. I searched for it for a long time. The reason is that utf8 of Windows is with bom, and the file generated by go has no bom, resulting in garbled codes. The solution is to modify the toast. Go file by adding a line 'content = "\uFEFF" + content' under line 343 (method invokeTemporaryScript) This sentence means to add the bom identification before the generated file, so that it is ok

大佬牛啊,解决了!
A wonderful solution, that I've solved this problem by it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants