linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Fedin <sonic_amiga@rambler.ru>
To: Roman Zippel <zippel@linux-m68k.org>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] Full NLS support for HFS (classic) filesystem
Date: Tue, 31 May 2005 17:21:09 -0400	[thread overview]
Message-ID: <429CD545.1070308@rambler.ru> (raw)
In-Reply-To: <Pine.LNX.4.61.0505311401290.3728@scrub.home>

Roman Zippel wrote:

>>>Use different mount points. This is not a reason to create a lot of
>>>different options all doing the same.
>>
>> Why??? It's incomfortable for the user!
> 
> 
> Because it's a user space problem, if you want to use different codepages 
> for different cd's tell it to mount. The kernel only provides the 
> functionality, giving the same functionality several different names is 
> not an option.

  How is it possible (except using different mount points)?
  Besides, using different mount points is problematic with 
automounters, only first fstab entry is taken into account by them. 
Second point won't be mounted automatically by, for example, magicdev.
  Well, if you really don't care about users opinion and listen only to 
yourself, we can find a compromise. iso9660 currently does not use 
"codepage" option, udf will never use it because stores names in 
Unicode. So we can rename this option to "codepage". There seem to be no 
ISO discs with national 8-bit names so probably iso9660 will never need it.

>> Yes, it may find wrong file. But i mean here that HFS does not use string
>>comparison at all for finding a file but some specific hashing (i tried to
>>understand how it actually works and was unable to, too difficult). So it just
>>will not find many files at all, even if names are translated correctly. As i
>>say, i tried this, it completely failed.
> 
> 
> If the names were translated correctly, HFS would have found them. You 
> need to give me an example, which should have worked, but failed.

  I can't produce exact russian string (don't remember), but it was 
about 50% of all russian names.

>> Don't understand about dynamic NLS module. What code should it contain?
> 
> 
> Create the tables in a nls module and you can do whatever you want in the 
> uni2char/char2uni functions.

  Huh...
  The problem is: when using 8-bit iocharset and 8-bit codepage char2uni 
from codepage always gives the result but AFTER THIS uni2char to 
iocharset does NOT necessarily gives the result. There are characters in 
codepage which have no equivalents in iocharset. They will be lost, you 
suggest to turn them into '?'. But how to reverse this in order to 
supply to hfs_strcmp()?
  If i leave it unreversed, convert second hfs_strcmp() argument to 
iocharset too, then hfs_strcmp() gives wrong results. It can return 1 
for the cases where it would return -1 if names are supplied in original 
Mac encoding. Look for example at KOI8-R and CP10007 (Mac Cyrillic) 
pages. Note that order of the characters is completely different. For 
example 'X'>'Y' in Mac encoding and 'X'<'Y' in koi8 (here 'X' and 'Y' 
are just substitutions, i assume some two russian characters there. 
There's no way to get around this. B-Tree scanning in __hfs_brec_find() 
routine just works wrong.

> Why don't you believe me there is a better solution? :)

  I just know that the usual algorythm used for example in FAT will not 
work. I totally broke my brain when tried to find a solution. Well, the 
whole B-Tree scanning routine can be totally rewritten in order to check 
every name in B-tree against the requested name, without using that '<' 
and '>' magic. But i guess it will be much slower. In addidion i'm just 
unable to rewrite this. HFS is a total mess and i have not enough spare 
time to put into its understanding. I wouldn't even try to rewrite such 
deep things, i'm afraid of breaking something. I completely don't 
understand HFS structure.
  Or, lexical order table in hfs/string.h can be regenerated dynamically 
correspondingly to used iocharset. But this will break hfs_hash_dentry() 
function which relies on this particular table too. Probably two tables 
can be used: original one and dynamically created one. But this requires 
the time i don't have. In addition, i guess you wouldn't like it too.

-- 
  Kind regards, Pavel Fedin

  reply	other threads:[~2005-05-31 13:20 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <429B1E35.2040905@rambler.ru>
2005-05-30 11:50 ` [PATCH] Full NLS support for HFS (classic) filesystem Roman Zippel
2005-05-31 13:37   ` Pavel Fedin
2005-05-31 10:45     ` Roman Zippel
2005-05-31 19:35       ` Pavel Fedin
2005-05-31 12:13         ` Roman Zippel
2005-05-31 21:21           ` Pavel Fedin [this message]
2005-05-31 13:59             ` Roman Zippel
2005-05-31 14:49               ` Anton Altaparmakov
2005-05-31 15:28                 ` Roman Zippel
2005-06-02 13:34                 ` Pavel Fedin
2005-06-02  9:24                   ` Anton Altaparmakov
2005-06-03 13:34                     ` Pavel Fedin
2005-06-03  8:09                       ` Anton Altaparmakov
2005-06-06 13:15                         ` Pavel Fedin
2005-06-06 12:44                           ` Roman Zippel
2005-06-06 21:44                             ` Pavel Fedin
2005-06-06 14:44                               ` Roman Zippel
2005-06-08 18:08                                 ` Pavel Fedin
2005-06-01  0:26             ` Roman Zippel
     [not found]               ` <429F0869.4010805@rambler.ru>
     [not found]                 ` <Pine.LNX.4.61.0506021130290.3728@scrub.home>
2005-06-03 14:00                   ` Pavel Fedin
2005-06-09 23:47   ` George Anzinger
2005-05-30 14:05 Pavel Fedin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=429CD545.1070308@rambler.ru \
    --to=sonic_amiga@rambler.ru \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=zippel@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).