]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
calendar: use iconv to respect the output encoding
authorbapt <bapt@FreeBSD.org>
Wed, 20 Feb 2019 06:40:52 +0000 (06:40 +0000)
committerbapt <bapt@FreeBSD.org>
Wed, 20 Feb 2019 06:40:52 +0000 (06:40 +0000)
commita960df88d00248ad910fecca3998f4e3195fb271
tree43807c4ed18a9e1ecfaeb2d25c3b8b663780c946
parent42cd3469751e6cbb44c244d212c15c24930f9cd4
calendar: use iconv to respect the output encoding

calendar(1) can have input in various encoding, specifying
LANG=<locale_name> to enable calendar(1) to determine which one to use.

The problem is the content of the calendar itself is exposed as is making it
unreadable in many cases. For example french calendar which is encoded
ISO8859-1 is rendered badly in a fr_FR.UTF-8 environment.

Using iconv allows to solve this issue.
This will also allow to keep only 1 encoding in base for those files without
breaking user existing setup

Reported by: many
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D19221
usr.bin/calendar/Makefile
usr.bin/calendar/calendar.c
usr.bin/calendar/calendar.h
usr.bin/calendar/events.c
usr.bin/calendar/io.c