Merge and unicode

J. Landman Gay jacque at hyperactivesw.com
Tue Sep 10 23:45:17 EDT 2019


I wondered about using htmltext in the merge too, but before I started 
using merge I was setting the properties one by one in a handler. Here's 
part of my original handler, where pResults is a list of lines that 
match search criteria:

  repeat for each line l in pResults
     put item 1 of l & tLineBreak & char 6 to -1 of item 2 of l &cr 
after tList
   end repeat
   lock screen
   put tList into fld "searchResults"
   repeat with x = 1 to the num of lines in fld "searchResults"
     set the leftIndent of paragraph x of fld "searchResults" to 10
     set the spaceBelow of paragraph x of fld "searchResults" to 20
     set the metadata of paragraph x of fld "searchResults" to line x of 
pResults
     set the textcolor of char 1 to offset(tLineBreak,line x of fld 
"searchResults") of line x of fld "searchResults" to tHiliteColor
     set the textsize of char 1 to offset(tLineBreak,line x of fld 
"searchResults") of line x of fld "searchResults" to 16
   end repeat
   unlock screen

The metadata still came out wrong. It also took a long time if there 
were many lines, due to all the field access, so I switched over to 
merge to create htmltext.

I'll try the replacement method you mentioned in another post. Thanks 
for chiming in here.

On 9/10/19 3:27 PM, Dar Scott Consulting via use-livecode wrote:
> I looked at this some more on OS X. I'm not seeing a problem with merge. And I'm not seeing a problem with metadata per se, I don't think. But I am seeing a problem with setting metadata with htmlText.
> 
> 
>> On Sep 10, 2019, at 1:32 PM, J. Landman Gay via use-livecode <use-livecode at lists.runrev.com> wrote:
>>
>> On 9/10/19 1:47 PM, J. Landman Gay via use-livecode wrote:
>>> :)
>>> 1. Jacque is very confused too, but is afraid of big sticks.
>>> 2. Encoding should be identical throughout. I'm working with a large text block, pulling out sections to create a list. All data is retrieved from othe same variable, which is UTF16 native LC text.
>>> 3. The metadata is only set at the "paragraph" level, which I need instead of "line" because there is a soft return in each entry.
>>> 4. I did try to textDecode the metadata, but since it was already decoded in the source, decoding came out as garbage. I even tried encoding it too, knowing it wouldn't work, and I was right.
>>> Solution: urlEncode the metadata before merging, and urlDecode after retrieval. When my example is urlEncoded it becomes a simple string:
>>> PP04_The+%D2Mystery%D3+of+Marriage
>>
>> Blah. URLEncode/decode works fine on desktop (Mac) but on Android it fails. For some reason on Android I get this:
>> PP04_The%2B%253FMystery%253F%2Bof%2BMarriage
>>
>> All tests are in LC 9.5 so there should be no difference, right?
>> -- 
>> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
>> HyperActive Software           |     http://www.hyperactivesw.com
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 


-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list