• 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: Latin-1 output
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Latin-1 output


  • Subject: Re: Latin-1 output
  • From: Philip Aker <email@hidden>
  • Date: Mon, 21 Jul 2008 04:16:49 -0700

On 08-07-21, at 03:14, Jan Erik Moström wrote:

I'm trying to figure out how I should write to get AS to use latin-1 when writing to a file

write "Hello" as ???? to f

I can't find any hint on how to do this, does anyone know?

Here's one possibility:

set utxt to "héllö" as Unicode text
set dest to quoted form of (POSIX path of ((choose file name) as text))
set tfile to "/tmp/utxt.txt"
set pfile to (POSIX file tfile)

try
set f to open for access pfile with write permission
write utxt to f as «class utf8»
close access f
on error errs number errn
try
close access f
end try
end try

do shell script "iconv -f UTF-8 -t LATIN1 " & tfile & " > " & dest


Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

 _______________________________________________
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/archives/applescript-users

This email sent to email@hidden

References: 
 >Latin-1 output (From: Jan Erik Moström <email@hidden>)

  • Prev by Date: Latin-1 output
  • Next by Date: Getting a color value
  • Previous by thread: Latin-1 output
  • Next by thread: Getting a color value
  • Index(es):
    • Date
    • Thread