Finding items in Unicode data

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
larryh
Posts: 32
Joined: Sat Mar 22, 2008 6:02 pm

Finding items in Unicode data

Post by larryh » Wed Apr 09, 2008 9:26 am

Hi,

For some reason I have to delete the first char at the beginning of my last item in order for the following to work:

if the hilitedLine is not empty then

put the hilitedLine of me into tHiLiteNum
put last item of line tHiLiteNum of me into tuDestCardIDNumber
delete char 1 in tuDestCardIDNumber
put uniDecode(tDestCardIDNumber) into taDestCardIDNumber
go to card id taDestCardIDNumber
end if

where tu = temp unicode variable, and ta = temp ansi variable

Can anyone explain why I have to delete the char 1? When I generate the field data, I put:

dataA(which is already in UTF16) & UniEncode(comma & space) & dataB

It seems odd to me that I just delete one character rather than 2 and it seems even more odd that a char would need to be deleted at all.

LarryH

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Wed Apr 09, 2008 10:22 am

Hi Larry,

You can't use chunks with Unicode. You're just lucky that you get something that looks like Unicode after deleting the preceding NULL character and using unidecode.

I do use chunks, sometimes, but before I do so I replace the unicode equivalent of the chunk delimiter by its plain text equivalent and use that to get chunks. Afterwards, I convert the plain text delimiters back into unicode, if necessary. This doesn't always work, so I do a lot of testing if I try this.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

larryh
Posts: 32
Joined: Sat Mar 22, 2008 6:02 pm

Post by larryh » Wed Apr 09, 2008 6:01 pm

I think revolution needs to support UTF8 without conversion. This would make life SO MUCH easier. I'll add it in enhancement requests. I use UTF8 constantly for multilingual material.

Thanks for the tip!

Larry

Post Reply