Some1 Posted January 11, 2016 Share Posted January 11, 2016 Bug Submission:Category: GeneralIssue Title: utf8substr and utf8strlen linux issueIssue Description: Both functions aren't working as intended on LINUX_STEAM based platforms (not sure about OSX_STEAM).This causes instant game crash in Text:SetTruncatedString function, when it receives something not-so-english:)System info:System Name: LinuxHost Name: iliapcRelease(Kernel) Version: 3.16.0-4-amd64Kernel Build Timestamp: #1 SMP Debian 3.16.7-ckt20-1+deb8u2 (2016-01-02)Machine Arch: x86_64Don't Starve Together: 162028 LINUX_STEAMSteps to Reproduce: Check this:print(utf8substr("абвabc",2,5))print(utf8strlen("абв")) Link to comment https://forums.kleientertainment.com/forums/topic/62280-general-utf8substr-and-utf8strlen-linux-issue/ Share on other sites More sharing options...
Some1 Posted January 11, 2016 Author Share Posted January 11, 2016 Meanwhile I override these, using one wonderful library. Link to comment https://forums.kleientertainment.com/forums/topic/62280-general-utf8substr-and-utf8strlen-linux-issue/#findComment-707896 Share on other sites More sharing options...
Developer PeterA Posted January 12, 2016 Developer Share Posted January 12, 2016 Thanks @Some1, we're looking into the issue. Link to comment https://forums.kleientertainment.com/forums/topic/62280-general-utf8substr-and-utf8strlen-linux-issue/#findComment-708127 Share on other sites More sharing options...
Some1 Posted January 12, 2016 Author Share Posted January 12, 2016 Yeah, @PeterA, one more weird thing is that utf8substr handles c-like zero-based numbering for the first ("begin") parameter, while using lua-like numbering for the second one ("end"). Would you fix this? Also maybe you should put them into strings table (strings.utf8sub instead of utf8substr, strings.utf8len instead of utf8strlen) and make them more lua-like (to handle default and negative parameters) (here there an example of my own wrapper to utf8substr). What do you think? And if you check the link I posted above, you may find it good idea to implement other utf8 stuff aswell Link to comment https://forums.kleientertainment.com/forums/topic/62280-general-utf8substr-and-utf8strlen-linux-issue/#findComment-708153 Share on other sites More sharing options...
Developer V2C Posted January 14, 2016 Developer Share Posted January 14, 2016 We've made a few changes in update 162425: (Previously, utf8substr was actually taking zero-based index and length, not "end".) We've updated utf8substr to match lua's string.sub instead now, so it will take 1-based "begin" and 1-based "end", with support for negative values to count from the end. It is also hooked up to the string class now, so all of these calls are now valid:utf8substr(my_string_variable, 1, -2)string.utf8sub(my_string_variable, 1, -2)my_string_variable:utf8sub(1, -2) Link to comment https://forums.kleientertainment.com/forums/topic/62280-general-utf8substr-and-utf8strlen-linux-issue/#findComment-708717 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.