Giter VIP home page Giter VIP logo

Comments (3)

chexiongsheng avatar chexiongsheng commented on June 21, 2024

il2cpp pinvoke本身也有同样的bug,如果要修正,原生接口将不能直接声明为string,而是传byte[]和长度,这样会多一个Encoding.UTF8.GetBytes调用,增加一个byte[]数组的分配和gc
其次xil2cpp版本用到的il2cpp::utils::StringUtils::Utf16ToUtf8也有该bug,改为调用utf8::unchecked::utf16to8需要增加utils/utf8-cpp/source/utf8/unchecked.h的引用,这个修改不知道各unity版本的兼容性如何。

考虑到unity本身也有类似的bug,之前也甚少项目反馈这问题,所以本issue的修改先不合入到master,先放到这个分支:https://github.com/Tencent/puerts/commits/fix_null_terminator_inside_string_being_cut

from puerts.

mingxxming avatar mingxxming commented on June 21, 2024

如果 \0 不截断是不是也会有问题。。有遇到base64 的string末尾多几个字符以及在linux下读取js文件多几个字符的情况,都是加\0后得以解决的。

from puerts.

chexiongsheng avatar chexiongsheng commented on June 21, 2024

如果 \0 不截断是不是也会有问题。。有遇到base64 的string末尾多几个字符以及在linux下读取js文件多几个字符的情况,都是加\0后得以解决的。

通过长度识别结尾

from puerts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.