Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] Reading kanji file name from Mac OS X
- Date: Wed, 05 Jul 2006 10:30:49 +0900
- From: David Riggs <dariggs@example.com>
- Subject: Re: [tlug] Reading kanji file name from Mac OS X
- References: <mailman.36.1152025166.2473.tlug@example.com>
- User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20050420 Debian/1.7.7-2
Thanks for the suggestions Stephen, I can sometimes read some of the file names in emacs, but its a real hassel.It seems that using WinXP is indeed the best way to handle this-- the Mac OS kanji file names are a mess.Just for the record, here is my little note to myself about how to bring over a dir tree of Mac files with kanji and spaces and upper case ascii in the file names and translate from their names in sjis to utf-8, also converting spaces to "." and lowercasing ascii. And convert content too!Copy to usb in WinXP, mount it in Linux as -o iocharset=sjis and then do the following to convert to utf-8 and no-blank file names. Go to the top level dir that contains the files from Mac. To clean upMac _directory_ names of blanks, converting the blank to a "." run repeatedly until no errors are reported:find * -type d -print0 | xargs -0 rename 's/ /./g' (Several runs may be needed due to the problem of renaming a folder that has already had a higher level rename done because it is itselfcontained in folder that has a blank in the name. To properly separate file names despite the blanks, -print0 directsl to usenull instead of blank for separators, and xargs -0 recognizes that.) Then run for _files_ (should not be any more errors): find * -type f -print0 | xargs -0 rename 's/ /./g' Then convert kanji file names to utf-8, and also lowercase ascii. Ifthere are garbage, or non-sjis kanji names, "convmv" will report it and stop and you may have to correct non-sjis names manually, then rerun."convmv" does its own recursion into directories. convmv -r -f sjis -t utf-8 --notest --lower *Then convert data, both line breaks and encoding, (should be no blanks in names, but just in case use -printf0):find * -type f -print0 |xargs -0 recode -f sjis/cl..utf-8/ Hope it is useful to someone, David Riggs Kyoto
- Follow-Ups:
- Re: [tlug] Reading kanji file name from Mac OS X
- From: Stephen J. Turnbull
Home | Main Index | Thread Index
- Prev by Date: [tlug] More on CentOS and Japanese input
- Next by Date: Re: [tlug] SCIM/Anthy on CentOS
- Previous by thread: Re: [tlug] More on CentOS and Japanese input
- Next by thread: Re: [tlug] Reading kanji file name from Mac OS X
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links