Re: Routines for review: Hex <-> String
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.