<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Jari,<br>
<br>
I noticed more or less the same problem with
FCString:CreateParsedStrings() that I discovered in the mail
below.<br>
The function seems to not like (at least some) unicode strings.
The string I parsed with the separators "')^" looked something
like this:<br>
^fontMus(FontNameXXX,8192)^size(24)^nfx(0)<br>
(i.e. with three different unicode letters at the end: e0f3, e0f1
and e0f0)<br>
The string was split fine until the unicode part - that part was
removed from the FCStrings array.<br>
<br>
All the best,<br>
Jan<br>
<br>
Am 29.05.2015 um 22:14 schrieb Jan Angermüller:<br>
</div>
<blockquote cite="mid:5568C8A9.1080403@angermueller.com" type="cite">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
Jari,<br>
<br>
I noticed a weird problem with CreateEnigmaStrings and unicode
fonts.<br>
It occured at a forte-fortissimo created from three "f"s with the
unicode character U+E050.<br>
<br>
When calling FCString:CreateEnigmaStrings(true) the non-enigma
commands were removed (!), when the string contained<b> 3</b><b>
or more</b> "f"s in a row. But they were split correctly when it
were only <b>1 or 2</b> "f"s.<br>
Below is the code (Bravura is used just for demonstration
purposes,it holds the violin clef on U+E050, not an "f"). The
first two splits work fine, while the next two runs return a
length of zero and an empty string.<br>
And of course, it also works fine for the non-unicode range (fifth
run).<br>
The same bug occurs if you change the unicode value to any other
character from the widespread U+EXXX range.<br>
<br>
Any ideas ?<br>
<br>
All the best,<br>
Jan<br>
<br>
function SplitEnigma(text)<br>
--Create enigma strings and print all non-enigma commands
(i.e. all texts)<br>
print("String to split:",text.LuaString)<br>
local splittext=text:CreateEnigmaStrings(true)<br>
for i in each(splittext) do<br>
if not i:IsEnigmaCommand() then<br>
print("Len:",string.len(i.LuaString),"String:",i.LuaString)<br>
end<br>
end<br>
end<br>
<br>
function UnicodeToUTF(number) --unicode to UTF conversion for
numbers between 2048 and 65535<br>
return string.char(bit32.bor(224,bit32.rshift(number,12))) ..
string.char(bit32.bor(128,bit32.band(bit32.rshift(number,6),63)))..
string.char(bit32.bor(128,bit32.band(number,63)))<br>
end<br>
<br>
local text=finale.FCString()<br>
text.LuaString="^fontMus(Bravura,8192)^size(24)^nfx(0)"..UnicodeToUTF(57424)<br>
SplitEnigma(text)<br>
text.LuaString="^fontMus(Bravura,8192)^size(24)^nfx(0)"..UnicodeToUTF(57424)..UnicodeToUTF(57424)<br>
SplitEnigma(text)<br>
text.LuaString="^fontMus(Bravura,8192)^size(24)^nfx(0)"..UnicodeToUTF(57424)..UnicodeToUTF(57424)..UnicodeToUTF(57424)<br>
SplitEnigma(text)<br>
text.LuaString="^fontMus(Bravura,8192)^size(24)^nfx(0)"..UnicodeToUTF(57424)..UnicodeToUTF(57424)..UnicodeToUTF(57424)..UnicodeToUTF(57424)<br>
SplitEnigma(text)<br>
text.LuaString="^fontMus(Bravura,8192)^size(24)^nfx(0)"..string.char(123)..string.char(123)..string.char(123)..string.char(123)<br>
SplitEnigma(text)<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
JWLua mailing list
<a class="moz-txt-link-abbreviated" href="mailto:JWLua@jwmusic.nu">JWLua@jwmusic.nu</a>
<a class="moz-txt-link-freetext" href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Jan Angermüller
Jevenstedter Str. 80
22547 Hamburg
Tel. 040 - 28 94 84 82
<a class="moz-txt-link-abbreviated" href="http://www.angermueller.com">www.angermueller.com</a>
</pre>
</body>
</html>