Hello
I'm trying to decipher the list of recent items of an application.
It's stored in a preferences file : com.apple.iWork.Pages.LSSharedFileList.plist for instance.
The path is stored in a long list of hexadecimal values.
My problem is that is such list, we may have characters encoded in a single byte and some encoded in two bytes. Here, 6E, 6F are single bytes but C2A0 is the double byte describing NOBREAKSPACE.
6E
|
6F
|
C2
|
A0
|
62
|
72
|
65
|
61
|
6B
|
2E
|
70
|
61
|
67
|
65
|
73
|
How may I decipher this kind of data? If I write it in a text file with the UTF8 BOM, TextEdit is able to read it but I wish to read it with AppleScript without an auxiliary app.
If I use read, I don't get the NOBREAKSPACE but ¬† . If I use read as «class UTF8», I get : «data UTF8EFBBBF6E6FC2A0627265616B2E7061676573» which is what I have as original datas. If I use read as Unicode text, I get a set of eastern characters. I'm really puzzled.
For sure, I guess that Emmanuel will write that we may do that with Smile (or maybe simply with Satimage) but I can't imagine that there is no way to read an UTF8 piece of text thru AppleScript.
Yvan KOENIG (VALLAURIS, France) dimanche 20 février 2011 17:25:04
|