Re: [RFC PATCH 3/3] nls: Replace default nls table by correct iso8859-1 table

Pali Rohár
2023-02-04T10:58:23Z

On Tuesday 10 January 2023 18:23:33 OGAWA Hirofumi wrote:
> Pali Rohár <pali@kernel.org> writes:
>
> [...]
>
> > -static struct nls_table default_table = {
> > - .charset = "default",
> > +static struct nls_table iso8859_1_table = {
> > + .charset = "iso8859-1",
> > .uni2char = uni2char,
> > .char2uni = char2uni,
> > .charset2lower = charset2lower,
> > .charset2upper = charset2upper,
> > };
>
> iocharset=default was gone with this (user visible) change? (nobody
> notice it though)
>
> > -/* Returns a simple default translation table */
> > +/* Returns a default translation table */
> > struct nls_table *load_nls_default(void)
> > {
> > struct nls_table *default_nls;
> > @@ -537,9 +419,22 @@ struct nls_table *load_nls_default(void)
> > if (default_nls != NULL)
> > return default_nls;
> > else
> > - return &default_table;
> > + return &iso8859_1_table;
> > +}
> > +
> > +static int __init init_nls(void)
> > +{
> > + return register_nls(&iso8859_1_table);
> > }
> >
> > +static void __exit exit_nls(void)
> > +{
> > + unregister_nls(&iso8859_1_table);
> > +}
> > +
> > +module_init(init_nls)
> > +module_exit(exit_nls)
>
> [...]
>
> Do we need to merge nls_iso8859-1.c to nls_base.c?
>
> obj-$(CONFIG_NLS) += nls_iso8859-1.o nls_base.o
>
> Something like this (untested), maybe cleaner.
>
> Thanks.
> --
> OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

I will look at it.