svn commit: r335836 - head/usr.bin/top

Hiroki Sato hrs at FreeBSD.org
Wed Jul 4 16:41:14 UTC 2018


Hiroki Sato <hrs at FreeBSD.org> wrote
  in <20180703.020956.859981414196673670.hrs at allbsd.org>:

hr> 後藤大地 <daichigoto at icloud.com> wrote
hr>   in <459BD898-8072-426E-A968-96C1382AC616 at icloud.com>:
hr>
hr> da>
hr> da>
hr> da> > 2018/07/02 15:55、Hiroki Sato <hrs at FreeBSD.org>のメール:
hr> da> >
hr> da> > Eitan Adler <lists at eitanadler.com> wrote
hr> da> >  in <CAF6rxg=Zjkf6EbSgt1fBQBUDHGKWwLf=n9ZJweJH+Di800kJ3w at mail.gmail.com>:
hr> da> >
hr> da> > li> On 1 July 2018 at 10:08, Conrad Meyer <cem at freebsd.org> wrote:
hr> da> > li> > Hi Daichi,
hr> da> > li> >
hr> da> > li> >
hr> da> > li> >
hr> da> > li> > I don't think code to decode UTF-8 belongs in top(1).  I don't know
hr> da> > li> > what the goal of this routine is, but I doubt this is the right way to
hr> da> > li> > accomplish it.
hr> da> > li>
hr> da> > li> For the record, I agree. This is why I didn't click "accept" on the
hr> da> > li> revision. I don't fully oppose leaving it in top(1) for now as we work
hr> da> > li> out the API, but long term its the wrong place.
hr> da> > li>
hr> da> > li> https://reviews.freebsd.org/D16058 is the review.
hr> da> >
hr> da> > I strongly object this kind of encoding-specific routine.  Please
hr> da> > back out it.  The problem is that top(1) does not support multibyte
hr> da> > encoding in functions for printing, and using C99 wide/multibyte
hr> da> > character manipulation API such as iswprint(3) is the way to solve
hr> da> > it.  Doing getenv("LANG") and assuming an encoding based on it is a
hr> da> > very bad practice to internationalize software.
hr> da> >
hr> da> > -- Hiroki
hr> da>
hr> da> I respect what you mean.
hr> da>
hr> da> Once I back out, I will begin implementing it in a different way.
hr> da> Please advise which function should be used for implementation
hr> da> (iswprint (3) and what other functions should be used?)
hr>
hr>  Roughly speaking, POSIX/XPG/C99 I18N model requires the following
hr>  steps:
(snip)

 Are you going to back out r335836, or disagree about it?

 If there is no objection in the next 24 hours, I will commit the
 attached patch.  This should be a minimal change to support multibyte
 characters in ARGV array depending on LC_CTYPE, not limited to UTF-8.

-- Hiroki
-------------- next part --------------
A non-text attachment was scrubbed...
Name: top_mbsupport.20180705-1.diff
Type: text/x-patch
Size: 6707 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20180705/3d1361da/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 163 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20180705/3d1361da/attachment.sig>


More information about the svn-src-head mailing list