• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: "~" vs. "POSIX file"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "~" vs. "POSIX file"


  • Subject: Re: "~" vs. "POSIX file"
  • From: kai <email@hidden>
  • Date: Wed, 25 Oct 2006 23:09:45 +0100


On 25 Oct 2006, at 16:21, Nigel Garvey wrote:

Quoting the wrong message, <email@hidden> wrote on Wed, 25 Oct
2006 08:09:47 -0400:

Nigel: what would you expect system attribute HOME to return other
than "plain text"?  Do you mean it's not Unicode text?  Not sure what
distinction you're making.

It's not Unicode text. Since the received wisdom is that paths should be
Unicode text to allow for non-Latin characters, I'd expect a Unicode
result from system attribute "HOME". Or is there some other rule that the
POSIX path of a home folder must be representable in plain text?

Since <system attribute "HOME"> returns "/Users/<user short name>", I wondered what might happen if I tried entering some exotic characters for a new account name. No problem doing that with the name itself - but it's evidently not possible to enter/paste non-latin characters in a *short* name. (When I entered "新しいノート" as the name for the new account, the short name proposed was "xinshiinoto".)


So what happens if one tries using <system attribute "HOME">, instead of the <path to...> command, as a base path - and then append a filename containing non-Latin characters?

--------
set f to choose from list (list folder (path to desktop) without invisibles)
if f is false then error number -128
set t to ((system attribute "HOME") & "/Desktop/" & f)
{t's class, t} --> {string, "/Users/kai/Desktop/新しいノート.jpg"}
--------


The string class, resulting as it does from concatenating plain and Unicode text, is actually styled text - and the style data seems to be enough to preserve the non-Latin characters. However, because of that received wisdom, one can't help wondering...

---
kai


_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: "~" vs. "POSIX file"
      • From: Christopher Nebel <email@hidden>
References: 
 >Re: "~" vs. "POSIX file" (From: "Nigel Garvey" <email@hidden>)

  • Prev by Date: Re: Entourage Rule to modify incoming email message source
  • Next by Date: Re: "~" vs. "POSIX file"
  • Previous by thread: Re: "~" vs. "POSIX file"
  • Next by thread: Re: "~" vs. "POSIX file"
  • Index(es):
    • Date
    • Thread