Closed dezashibi closed 1 year ago
I think it is now fixed. That function writes a null character at the end and there was no space for it.
yes it's fixed now, thanks sā
BTW, in a loop like that it is better to use
for (int i{0}; i < c.length(); ++i)
instead of:
for (int i{0}; i < a.count(); ++i)
because count() has to go through the string every time, but c.length() (the array of code points) is already computed.
Definitely, it wasn't the actual code, I was testing to make sure the count() also is correct. Thanks anyway š
On Tue, Jul 18, 2023, 10:26 aslze @.***> wrote:
BTW, in a loop like that it is better to use
for (int i{0}; i < c.length(); ++i)
instead of:
for (int i{0}; i < a.count(); ++i)
because count() has to go through the string every time, but c.length() (the array of code points) is fixed.
ā Reply to this email directly, view it on GitHub https://github.com/aslze/asl/issues/21#issuecomment-1639580062, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANVCKEE6GZEIDX5I4ETTR3DXQYUCJANCNFSM6AAAAAA2N2MYVA . You are receiving this because you modified the open/close state.Message ID: @.***>
when
String
contains any utf8 characters like an emoji or a character from another languagechars()
works as expected, but whenString
contains only ascii characters, callingchars()
causes the following error, and it seems it has something related to memory clean up or in the destructor.this code for example, this works until pressing a key, and what happens after is just destructing
c
anda
. I'm checking this lineint n = utf8toUtf32(str(), c.ptr(), 1);
that I think it might be this.