Bug 151833

Summary: sysutils/kiconvtool: I don't know how to load the pair (UTF-8 -> _wctype)
Product: Ports & Packages Reporter: daniele <glimp>
Component: Individual Port(s)Assignee: Dmitry Marakasov <amdmi3>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description daniele 2010-10-30 17:00:26 UTC
As a standard user I could not succesfully execute 

'mount_msdosfs -L en_US.UTF-8 /dev/da0s1 local/mnt'

I installed kiconvtool and added the following lines to /etc/rc.conf 

kiconv_preload="YES"
kiconv_local_charsets="UTF-8"
kiconv_foreign_charsets="UTF-16BE UTF-8"

Even with this I could not execute the preceding command as a standard user.

Taking a look at the code I discovered that "mount_msdosfs -L en_US.UTF-8 /dev/da0s1 local/mnt" when starts up sets its locale to en_US.UTF-8 [1]. And this leads to loading also the pair (UTF-8,_wctype) [2]. So, apparently, if that pair is not loaded, standard users can not execute the preceding command.

At this point the problem that arises is that at command line I do not know how to specify the charset _wctype (unless this is not possible) and feed kiconvtool. 

To solve the problem, I then modified kiconvtool (explained below) so that the pair (UTF-8, _wctype) is loaded automatically.

d

[1] /usr/src/sbin/mount_msdosfs/mount_msdosfs.c    - Line 114
[2] /usr/src/lib/libkiconv/xlat16_iconv.c          - Line 123

Fix: The workaround to solve this __specific__ problem was to apply the following patch and rebuild kiconvtool. 
Please *note* that this patch is not intended for general usage but just to give an idea of a base to further improve the port in case it is not possible to specify _wctype at command line (or to remove the requirement).
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2010-10-30 17:00:33 UTC
Responsible Changed
From-To: freebsd-ports-bugs->amdmi3

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Dmitry Marakasov freebsd_committer freebsd_triage 2011-09-08 00:54:44 UTC
State Changed
From-To: open->closed

Should be fixed with 0.95 update