Mailinglist Archive: packet-writing (43 mails)

< Previous Next >
Re: International characters on UDF-FS
  • From: Ben Fennema <bfennema@xxxxxxxxx>
  • Date: Fri, 20 Jun 2003 11:50:50 +0000 (UTC)
  • Message-id: <3EF2F9FF.4040701@xxxxxxxxx>
You can just mount with -o iocharset=<whatever> (default, iso8859-1, etc)

Linux UDF defaults to utf8 if you don't specific the character set.


James H. Cloos Jr. wrote:
Stephen> I'm not sure. I'm just copying them directly from my hard
Stephen> disk, which is reiserfs.

Stephen> The system's configured with ISO 8859-1 as its default
Stephen> character map, if that information helps in any way.

Yes, that does suggest that the filenames are in latin1 on the reiser
filesystem. The error you get suggests the udf filesystem requires
that non-ascii filenames be in utf8. As such, you need to somehow
convert the names from latin1 to utf8 when copying the files over.

Without chaning your locale, something like this *might* work:

for ij in $*;do
kl=$(echo $ij|iconv -f latin1 -t utf8|tr -d \\n)
cp $ik ${dest}/${kl}

But it is untested, off the top of my head, and does not duplicate
the syntax of cp(1). (The target dir is the first arg of this
pseudo-code script, unlike cp(1) where it is the last arg.)

The downside of something like the above is that the filenames on
the udf fs won't look right in a non-utf8 locale. On most posix
filesystems -- including ffs, ext2/3 and reiser -- the filenames
are just an octet-stream with only NULL and / disallowed. UDF,
OTOH, stipulates utf16 or utf8, IIRC. So perhaps the better answer
to your problem is to tar up the files and copy the tar archives to
the udf fs, rather than the individual files.


< Previous Next >
Follow Ups