Problem with revExecuteSQL - More

Brian Yennie briany at qldlearning.com
Thu Nov 1 15:59:12 EDT 2007


Dave,

I think all of these character set / UTF8 / shortened file path  
threads may be leading you on a wild goose chase. Certain characters  
must be escaped in XML, and ampersand is one of them. I believe you  
just need to unescape them.

Check this page: http://www.asciitable.com/

& is just an HTML/XML encoded entity for the ampersand.

This is untested, but you may be able to just do this:

set the htmlText of fld "hiddenField" to tFileName
put fld "hiddenField" into tFileName

The field should handle the HTML entities for you.

HTH,
Brian



> Hi,
>
> The path is coming out of the iTunes XML file. It's not just this  
> path, it's a load of them, for instance there are a lot of  
> instances that wherever there is an ampersand it is followed by  
> #38; There are files that have funny accents that cause the problem  
> too, If I read back the same track using AppleScript the weird  
> characters are not there.
>
> I think that the tracks where this occurs were imported from a PC.
>
> Thanks a lot
> All the Best
> Dave
>
> On 1 Nov 2007, at 19:22, Ian Wood wrote:
>
>> It looks like the folder name has been abbreviated at some stage  
>> by an OS that didn't understand file/folder names that long.
>>
>> Where *exactly* is the filepath coming from?
>>
>> Ian
>>
>> On 1 Nov 2007, at 18:01, Dave wrote:
>>
>>> However I now have a another weird problem, I have a field that  
>>> represents a file path, in this case the path is:
>>>
>>> /Users/Dave/Music/iTunes/iTunes Music/Blank & Jones/Addicted  
>>> To Trance (Disc 1)/11 DJs, Fans And Freaks.mp3
>>>
>>> However a "if there is a file" fails on this path. When I look I  
>>> can't see the & in the file name. I'm guessing it's something  
>>> to do with UTF16 vs UTF8 or something, but I'm not sure how to  
>>> resolve it. The database I am writing is set to UTF8 which AFAIK  
>>> is the only option for SQLite.





More information about the use-livecode mailing list