Omnimaga
Calculator Community => TI Calculators => Lua => Topic started by: Loulou 54 on December 10, 2011, 04:33:05 pm
-
Hi everyone. :)
I have a problem that I've already noted before, but it wasn't important in that situation. (in ABA Logique)
Now it becomes annoying.. This is for my traductor (http://ourl.ca/13193). :)
I've already had many problems with the accentuated characters from the word-lists but now it works.
Here is actually the problem that many would have already noted, I suppose :
when I get some special character with the on.charIn event, it produces bugs (displays chinese character or whatever..) and sometimes the following error:
Illegal unicode character in string.
How to avoid this ?
Thanks. :)
-
I've never had problems with on.charIn()
All the problems that I've had were with string.sub() (which I just had to replace with string.usub())
-
You can type an accentuated character without bugs ? With this kind of code, I get chinese characters or other bugs..
function on.charIn(ch)
msg=string.sub(msg,1,pos)..ch..string.sub(msg,pos+1) -- pos is the position where you insert what you're typing.
pos=pos+1
end
Maybe you do that in an other way ?
-
We have asked (Jim, I believe) TI to put some more unicode support, so maybe it will be better soon :-)
-
So it's more or less normal for the moment and I can't avoid it ?
Otherwise I could make a kind of a special character menu..
-
Why don't you use string.usub() instead of string.sub() ?
In my opinion, it should work
-
if you type é,è,à.. in it, it won't work, whatever string manipulation you use, nspire lua just doesn't recognizes them.
When you run it in the emulator (student/teacher software) it will just shut down, no error or something else, it just can't handle them
-
Why don't you use string.usub() instead of string.sub() ?
In my opinion, it should work
Oh yes indeed ! Sorry. ^^
Thank you ! :D
Solution : use string.usub instead of string.sub function.