Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Aug 2005 16:34:56 +0200
From:      Rudolf Cejka <cejkar@fit.vutbr.cz>
To:        "R. Imura" <imura@ryu16.org>
Cc:        current@freebsd.org
Subject:   Re: kiconv related enhancement
Message-ID:  <20050823143456.GA79107@fit.vutbr.cz>
In-Reply-To: <20050821092816.GA51886%imura@ryu16.org>
References:  <20050821092816.GA51886%imura@ryu16.org>

next in thread | previous in thread | raw e-mail | index | archive | help
R. Imura wrote (2005/08/21):
> http://people.freebsd.org/~imura/kiconv/
> I'm planning to commit above patches after FreeBSD-6.0 released.
> If you're interested, please test and report.

Hello, big thanks for your work on this! I have tested your patches
and they seem to be good from my user's point of view - see below,
which tables have been loaded and how they are now used.

Please, do you have a plan to fix ranges too? You have either allocate
sufficient space (ICONV_CSNMAXLEN + 1 instead of just ICONV_CSNMAXLEN),
or check for string length >= ICONV_CSNMAXLEN instead of > ICONV_CSNMAXLEN.
The second problem is that some strcpy()s could overwrite one byte
after allocated space and strnpcy()s could produce unterminated
strings - everything is around egrep -r "ICONV_C(S|NV)NMAXLEN" /usr/src.
The last problem is that sys/libkern/iconv.c does not check the length
of from and to in iconv_sysctl_add(), which can be source of unexpected
results.

Old:
====

grep kiconv /etc/rc.local
	/usr/local/sbin/kiconvctl add -m -l cs_CZ.ISO8859-2 -t UTF-16BE
	/usr/local/sbin/kiconvctl add -m -l cs_CZ.ISO8859-2 -t CP852
kiconvctl list (with forgotten mounted dos partition, but I think that
there would by all Refs = 1)
	Loaded Tables
	Id Refs From             To              
	 1    0 ISO8859-2        UTF-16BE        
	 2    0 UTF-16BE         ISO8859-2       
	 3    0 ISO8859-2        CP852           
	 4    0 CP852            ISO8859-2       

New:
====

grep kiconv /etc/rc.conf
	kiconv_load="YES"
	kiconv_locale="cs_CZ.ISO8859-2"
	kiconv_encoding="CP852"
kiconvctl list (with one user mounted dos partition)
	Loaded Tables
	Id Refs From             To              
	 1    0 UTF-8            UTF-16BE        
	 2    0 UTF-16BE         UTF-8           
	 3    2 ISO8859-2        UTF-16BE        
	 4    2 UTF-16BE         ISO8859-2       
	 5    4 ISO8859-2        _wctype         
	 6    1 CP852            UTF-16BE        
	 7    1 UTF-16BE         CP852           

Regards.

-- 
Rudolf Cejka <cejkar at fit.vutbr.cz> http://www.fit.vutbr.cz/~cejkar
Brno University of Technology, Faculty of Information Technology
Bozetechova 2, 612 66  Brno, Czech Republic



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050823143456.GA79107>