• 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
Converting UTF-16 files to UTF-8 or MacRoman (ascii)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Converting UTF-16 files to UTF-8 or MacRoman (ascii)


  • Subject: Converting UTF-16 files to UTF-8 or MacRoman (ascii)
  • From: "Mr. Dan Pouliot" <email@hidden>
  • Date: Fri, 27 Jul 2007 21:19:15 -0400


I need to automate the conversion of a UTF-16 file to either UTF-8 or MacRoman. I know this can be done w/BBEdit or maybe even TextWrangler, but I was hoping for a pure AppleScript solution. I've been banging my head against a wall. I've been reading the contents of the UTF-16 file, coercing it to a string, then writing it to a new file as a string. I've even tried the "extract string" command. In very case, the new file that's made starts out MacRoman, but as soon as I dump the text into it, it becomes UTF-16. I notice that when I display dialog on the first few characters of my data I can see the BOM is there. Trying to strip out the first 2 characters makes the file go wacky from a web browser perspective. Any help would be greatly appreciated!


--
Dan Pouliot <email@hidden>






_______________________________________________ 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
  • Follow-Ups:
    • Re: Converting UTF-16 files to UTF-8 or MacRoman (ascii)
      • From: Emmanuel <email@hidden>
    • Re: Converting UTF-16 files to UTF-8 or MacRoman (ascii)
      • From: Sander Tekelenburg <email@hidden>
    • Re: Converting UTF-16 files to UTF-8 or MacRoman (ascii)
      • From: Bill Briggs <email@hidden>
  • Prev by Date: Re: AppleScript and shell scripting
  • Next by Date: Re: AppleScript and shell scripting
  • Previous by thread: Re: AppleScript-Users Digest, Vol 4, Issue 351
  • Next by thread: Re: Converting UTF-16 files to UTF-8 or MacRoman (ascii)
  • Index(es):
    • Date
    • Thread