-
Notifications
You must be signed in to change notification settings - Fork 60.9k
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: 修复导出时字符乱码问题 #3972
fix: 修复导出时字符乱码问题 #3972
Conversation
@greenjerry is attempting to deploy a commit to the NextChat Team on Vercel. A member of the Team first needs to authorize it. |
Your build has completed! |
no |
downloadAs literally must be use binary |
Can you tell me why? I can pass the test on windows, macos, and web, including downloading json and markdown. The text field of the downloadAs method specifies that string is required, why cannot it be saved using writeTextFile? |
if you replace |
its backend unlike frontend |
also |
No, I didn't replace writeBinaryFile from the global perspective. The download image section is not in the downloadAs method, it is in line 491 of exporter. tsx. Therefore, I only replace the writeBinaryFile in the downloadAs method and it does not affect the image Furthermore, I did not remove writeBinaryFile from global. d.ts, so writeBinaryFile is still available in the project |
Without replacing writeBinaryFile, you can use ArrayBuffer as a bridge object, use Uint16Array to write data to ArrayBuffer, and use Uint8Array to wrap ArrayBuffer and pass it to writeBinaryFile |
you smart, that safe & better way |
…bled fix: 修复导出时字符乱码问题
修复导出json和markdown时中文及其他utf8字符乱码问题
乱码原因:
charCodeAt方法返回值范围在0~65535,不能直接转为uint8array
修复方式:
把downloadAs方法中的writeBinaryFile改为writeTextFile,参考文档