[JW Lua] FCString:TrimEnigmaFontTags() with unicode problems

Jan Angermüller jan at angermueller.com
Thu Jun 4 11:50:39 CEST 2015


Jari,

FCString:TrimEnigmaFontTags() seems to cut off unicode in some cases - 
see code below.
It resembles the problems in CreateParsedStrings and CreateEnigmaStrings:
If it ends with at least three unicode characters, they will be cut off.
If it ends with two unicode characters, it works fine.
If it ends with three unicode characters followed by an asci character, 
it works fine.

All the best,
Jan

local text=finale.FCString()
text.LuaString="^fontMus(FontNameXX,0)^size(24)^nfx(0)"
text:TrimEnigmaFontTags()
print("Text:"..text.LuaString..",Len:"..string.len(text.LuaString))

text.LuaString="^fontMus(FontNameXX,0)^size(24)^nfx(0)"
text:TrimEnigmaFontTags()
print("Text:"..text.LuaString..",Len:"..string.len(text.LuaString))

text.LuaString="^fontMus(FontNameXX,0)^size(24)^nfx(0)f"
text:TrimEnigmaFontTags()
print("Text:"..text.LuaString..",Len:"..string.len(text.LuaString))

Execution Output:
Running [Unnamed Script] ======>
Text:,Len:0
Text:,Len:6
Text:f,Len:10
<======= [Unnamed Script] succeeded (Processing time: 0.000 s).




More information about the JWLua mailing list