Code: Select all
function StrUTF8_UTF16(strText)
Is the parameter strText supposed to be a single UTF8 'character'? I was assuming not, as StrUtf8toUtf16 (which is called by StrUTF8_UTF16) takes a single character.
However, this code doesn't return what I expect.
Code: Select all
function UTF8MultiLinetoUTF16 (strString)
--strString is a UTF8 string with multiple lines within it
local tblConvertedLines = stringx.splitlines(strString)
--splitlines is a Penlight function to split a string into a list of lines. "\r", "\n", and "\r\n" are considered line ends but not included in the lines -- I have verified that the output of this stage is as expected
for i,v in ipairs(tblConvertedLines) do
tblConvertedLines[i]=StrUTF8_UTF16(v)
end
return tblConvertedLines
end
[.index]
Ver1=4
Ver2=0
Count=1
Item1=_ATTR-TASK-IA
[FCT-_ATTR-TASK-IA]
Name=Task
Template=<br>{label}: <{value}> {=CombineText( "[Мoкв: ", GetLabelledText( %FACT.NOTE2%, "Мoкв: " ), "]", "" )} {=CombineText( "[Priority: ", GetLabelledText(%FACT.NOTE2%, "Priority: " ), "]", "" )}
Event Tab={label}: <{value}> {=CombineText( "[Мoкв: ", GetLabelledText( %FACT.NOTE2%, "Мoкв: " ), "]", "" )} {=CombineText( "[Priority: ", GetLabelledText(%FACT.NOTE2%, "Priority: " ), "]", "" )}
Rec Win={label}: <{value}> {=CombineText( "[Мoкв: ", GetLabelledText( %FACT.NOTE2%, "Мoкв: " ), "]", "" )} {=CombineText( "[Priority: ", GetLabelledText(%FACT.NOTE2%, "Priority: " ), "]", "" )}
Label=Task
Abbr=
Timeframe=POST-DEATH
Field Date=0
Field Age=0
Field Place=0
Field Address=0
Field Note=1
Fast-Add Menu=Y
Hidden=N
[Text-FCT-_ATTR-TASK-IA-Auto Note]
Count=7
Line1=n;Мoкв: ;
Line2=n;Priority: ;
Line3=n;--------------------;
Line4=n;Objective:;
Line5=n;--------------------;
Line6=n;Notes:;
Line7=0;
[FCT-_ATTR-TASK-IA-ROLE]
Roles=0
Output:
Ver1=4嘀攀爀㈀㴀 ഀ
Count=1䤀琀攀洀㴀开䄀吀吀刀ⴀ吀䄀匀䬀ⴀ䤀䄀ഀ
[FCT-_ATTR-TASK-IA]一愀洀攀㴀吀愀猀欀ഀ
Template=<br>{label}: <{value}> {=CombineText( "[Мoкв: ", GetLabelledText( %FACT.NOTE2%, "Мoкв: " ), "]", "" )} {=CombineText( "[Priority: ", GetLabelledText(%FACT.NOTE2%, "Priority: " ), "]", "" )}䔀瘀攀渀琀 吀愀戀㴀笀氀愀戀攀氀紀㨀 㰀笀瘀愀氀甀攀紀㸀 笀㴀䌀漀洀戀椀渀攀吀攀砀琀⠀ ∀嬀ᰀ漄㨀㈄㨄 ∀Ⰰ 䜀攀琀䰀愀戀攀氀氀攀搀吀攀砀琀⠀ ─䘀䄀䌀吀⸀一伀吀䔀㈀─Ⰰ ∀ᰀ漄㨀㈄㨄 ∀ ⤀Ⰰ ∀崀∀Ⰰ ∀∀ ⤀紀 笀㴀䌀漀洀戀椀渀攀吀攀砀琀⠀ ∀嬀倀爀椀漀爀椀琀礀㨀 ∀Ⰰ 䜀攀琀䰀愀戀攀氀氀攀搀吀攀砀琀⠀─䘀䄀䌀吀⸀一伀吀䔀㈀─Ⰰ ∀倀爀椀漀爀椀琀礀㨀 ∀ ⤀Ⰰ ∀崀∀Ⰰ ∀∀ ⤀紀ഀ
Rec Win={label}: <{value}> {=CombineText( "[Мoкв: ", GetLabelledText( %FACT.NOTE2%, "Мoкв: " ), "]", "" )} {=CombineText( "[Priority: ", GetLabelledText(%FACT.NOTE2%, "Priority: " ), "]", "" )}䰀愀戀攀氀㴀吀愀猀欀ഀ
Abbr=吀椀洀攀昀爀愀洀攀㴀倀伀匀吀ⴀ䐀䔀䄀吀䠀ഀ
Field Date=0䘀椀攀氀搀 䄀最攀㴀 ഀ
Field Place=0䘀椀攀氀搀 䄀搀搀爀攀猀猀㴀 ഀ
Field Note=1䘀愀猀琀ⴀ䄀搀搀 䴀攀渀甀㴀夀ഀ
Hidden=N嬀吀攀砀琀ⴀ䘀䌀吀ⴀ开䄀吀吀刀ⴀ吀䄀匀䬀ⴀ䤀䄀ⴀ䄀甀琀漀 一漀琀攀崀ഀ
Count=7䰀椀渀攀㴀渀㬀ᰀ漄㨀㈄㨄 㬀ഀ
Line2=n;Priority: ;䰀椀渀攀㌀㴀渀㬀ⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀ㬀ഀ
Line4=n;Objective:;䰀椀渀攀㔀㴀渀㬀ⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀ㬀ഀ
Line6=n;Notes:;䰀椀渀攀㜀㴀 㬀ഀ
[FCT-_ATTR-TASK-IA-ROLE]刀漀氀攀猀㴀