On Fri, Nov 30, 2018 at 07:39:05PM -0500, Gabriel Krisman Bertazi wrote: > From: Gabriel Krisman Bertazi <krisman@xxxxxxxxxxxxxxx> > > Basic NLS support is required in e2fsprogs because of fsck, which > needsto calculate dx hashes for encoding aware filesystems. this patch > implements this infrastructure as well as ascii support. > > We don't need to do all the dance of versioning as we do in the kernel, > because we know before-hand which encodings and versions we > support (those we know how to store in the sb), so it is simpler just to > create static tables. > > Changes since v3: > - Prevent buffer overflow during normalization/casefold. > - Signal invalid sequences and let caller handle it. > [...] > diff --git a/lib/ext2fs/nls_ascii.c b/lib/ext2fs/nls_ascii.c > new file mode 100644 > index 000000000000..5d513df404c1 > --- /dev/null > +++ b/lib/ext2fs/nls_ascii.c > @@ -0,0 +1,68 @@ > +#include "nls.h" > + > +#include <errno.h> > +#include <string.h> > + > + > +static unsigned char charset_tolower(const struct nls_table *table, > + unsigned int c) > +{ > + if (c >= 'A' && c <= 'Z') > + return (c | 0x20); > + return c; > +} Is charset_tolower() supposed to be used for something? It's never called. - Eric