\x81 is used as a control character to denote a special char.
\x81 was encoded put in the end result twice because of a missing elif.
Includes unittest fix.
Enable punyencoding of directory names in mac mode.
A refactor of the code to handle punyencoding in mac mode.
It's now a two step process:
- first collect the resource forks into macbinaries and
- second punyencode recursively all files and directories
The dumper companion now support dumping mac_japanese isos. MachFS
expects encodes everything in mac_roman. For mac_japanese we decode it
as mac_roman and then encode it ourselve.
`dumper-companion.py iso --japanese --punycode path/to/iso path/to/dir`
- A conversion table and code was added: taken from:
https://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/JAPANESE.TXT
- file_to_macbin takes an encoded filename to allow for both mac_japanse
and mac_roman encodings.
- punyfication is now an explicit option when dumping isos
- mac mode: show which file's attributes can't be read
- mac mode: use exit code 1 when bailing
- implement exit codes for all modes
- fix spelling mistake
- sort imports, python once first, then external packages
- refactor: use os.path.join only once per file
`dumper-companion.py mac [--punycode] directory` will recursively look
for resourceforks and encode them inplace as macbinary.
When `--punycode` is enabled it will encode filenames in punycode.
This is a MacOS only feature.
Original dumper-companion.pl script encoded \x81 to \x81\x79\x81.
- added test to check for correct behavior
- refactored escape string to handle this special case
Adds the `str` subcommand:
./dumper-companion.py str STRING
punyencode the string STRING
./dumper-companion.py str --stdin
punyencode stdin
The HFS iso dumper is moved into it's own subcommand:
./dumper-companion.py iso -e encoding input_iso output_dir
This employs a "lazy" approach: the "format" for the credits stays
exactly as it was, i.e., perl code. Of course one may want to change
this to another format (e.g. YAML, JSON, XML; or also shell script or
AWK, like `configure.engine` uses). But I deliberately kept it simple,
to get a minimal change that is easy to verify. Any further changes to
e.g. the format can be layered atop this.
It reads an hfs formatted iso and extracts its contents. The output
follows two rules:
- A file is saved as macbinary when it has a resource fork and
- filenames with non-ascii chars are converted into a punycode variant.
An initial verson of this python script was created by: @eientei on
discord.