Skip to content

fix:修复readFile读取文件以base64的编码格式返回应用闪退 #10

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

Merged
merged 1 commit into from
Aug 31, 2024

Conversation

WN0904
Copy link

@WN0904 WN0904 commented Aug 31, 2024

Summary

请解释此次更改的 动机,以下是一些帮助您的要点:

  • close readFile读取文件以base64的编码格式返回应用闪退 #9
  • 使用readFile读取文件并且以base64的形式返回会应用闪退
  • 之前的实现方案是使用buffer.buffer.transcode()从utf-8转为base64的编码格式,返回新的buffer对象,通过对比Android,和iOS的实现源码,使用buffer.toString("base64")实现,返回的为base64编码格式的字符串

Test Plan

复现代码:ReactNativeBlobUtil.fs.readFile(文件地址, "base64")

Checklist

  • 已经在真机设备或模拟器上测试通过
  • 已经与 Android 或 iOS 平台做过效果/功能对比
  • 已经添加了对应 API 的测试用例(如需要)
  • 已经更新了文档(如需要)
  • 更新了 JS/TS 代码 (如有)

@mingmingaini mingmingaini merged commit 63ad083 into react-native-oh-library:sig Aug 31, 2024
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

Successfully merging this pull request may close these issues.

readFile读取文件以base64的编码格式返回应用闪退
3 participants