• 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: Routines for review: Hex <-> String
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Routines for review: Hex <-> String


  • Subject: Re: Routines for review: Hex <-> String
  • From: Philip Aker <email@hidden>
  • Date: Sun, 19 Jan 2003 20:39:38 -0800

On Sunday, January 19, 2003, at 02:48 PM, HAS wrote:

Several points to add:

1. Always use 'quoted form' property of strings and unicode text:

on stringToHex(str)
do shell script ("echo -n " & (quoted form of str) & " | hexdump -ve '1/1 \"X\"'")
end stringToHex

Good point.


2. Bugs I've found in hexToString's perl script:
- currently it errors on anything in the 80-FF range
- invalid chars currently end up in result (these should be caught, and a suitable error message raised)

I've got a way around that but it's dog slow and untested with Unicode. I used a bash 'printf' call (per hex byte).

What I'm thinking is that (at least for my purposes) what I need is the equivalent of a shell call ".gz.hqx" encoder/decoder. Of course ".gz" is not a problem (gzip) and I suspect the ".hqx" format could be something else (like base64). But I don't know the shell facility for this. Got an clue?


Cheers,

Philip Aker
http://www.aker.ca
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Routines for review: Hex <-> String (From: has <email@hidden>)

  • Prev by Date: Re: AS to Change Owner of files
  • Next by Date: String manip: from AppleScript to shell
  • Previous by thread: Re: Routines for review: Hex <-> String
  • Next by thread: Re: Routines for review: Hex <-> String
  • Index(es):
    • Date
    • Thread