From: Ken Hornstein Date: Mon, 20 Jan 2014 06:15:55 +0000 (-0500) Subject: Completely deprecate support for MM_CHARSET. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/e99539ae6376c4b33e1a23f2ce50830c0d107786?ds=sidebyside;hp=--cc Completely deprecate support for MM_CHARSET. --- e99539ae6376c4b33e1a23f2ce50830c0d107786 diff --git a/docs/contrib/ml b/docs/contrib/ml index f5796c4e..66bcf10d 100755 --- a/docs/contrib/ml +++ b/docs/contrib/ml @@ -117,7 +117,7 @@ do_viewhtml() > /tmp/ml-mhshow-html$$ MHSHOW=/tmp/ml-mhshow-html$$ \ - MM_CHARSET=us-ascii \ + LC_ALL=C \ mhshow -type text/html "$@" rm -f /tmp/ml-mhshow-html$$ diff --git a/docs/pending-release-notes b/docs/pending-release-notes index cfe66e3a..288b5674 100644 --- a/docs/pending-release-notes +++ b/docs/pending-release-notes @@ -109,6 +109,9 @@ OBSOLETE FEATURES ap(8) commands has been removed. - "make install" no longer strips executables. Use "make install-strip" instead. +- The environment variable MM_CHARSET to indicate the native character + set is no longer supported. The native character set will be solely + determined by the locale settings. ------------------- DEPRECATED FEATURES diff --git a/man/mh-profile.man b/man/mh-profile.man index 9f0190f5..47c59283 100644 --- a/man/mh-profile.man +++ b/man/mh-profile.man @@ -783,48 +783,6 @@ additional user profile (file) to be read by in addition to the mhn.defaults profile. .RE .PP -.B $MM_CHARSET -.RS 5 -With this environment variable, you can specify -the native character set you are using. You must be able to display -this character set on your terminal. -.PP -This variable is checked to see if a RFC 2047 header field should be -decoded (in -.BR inc , -.BR scan , -.BR mhl ). -This variable is -checked by -.B show -to see if the -.I showproc -or -.I showmimeproc -should -be called, since showmimeproc will be called if a text message uses -a character set that doesn't match -.BR $MM_CHARSET . -This variable is -checked by -.B mhshow -for matches against the charset parameter -of text contents to decide it the text content can be displayed -without modifications to your terminal. This variable is checked by -.B mhbuild -to decide what character set to specify in the charset -parameter of text contents containing 8\-bit characters. -.PP -When decoding text in such an alternate character set, -.B nmh -must be able to determine which characters are alphabetic, which -are control characters, etc. For many operating systems, this -will require enabling the support for locales (such as setting -the environment variable -.B $LC_CTYPE -to iso_8859_1). -.RE -.PP .B $MAILDROP .RS 5 This variable tells diff --git a/man/mhbuild.man b/man/mhbuild.man index 2f0e8ee7..9dbf05a8 100644 --- a/man/mhbuild.man +++ b/man/mhbuild.man @@ -448,7 +448,9 @@ If a text content contains any 8\-bit characters (characters with the high bit set) and the character set is not specified as above, then .B mhbuild will assume the character set is of the type given by the -environment variable MM_CHARSET. If this environment variable is not +standard +.IR locale (1) +environment variables. If these environment variables are not set, then the character set will be labeled as \*(lqx-unknown\*(rq. .PP If a text content contains only 7\-bit characters and the character set diff --git a/man/mhshow.man b/man/mhshow.man index f55fbfe6..9cc44c1b 100644 --- a/man/mhshow.man +++ b/man/mhshow.man @@ -328,15 +328,15 @@ encounters a \*(lqcharset\*(rq parameter for this content, it checks if your terminal can display this character set natively. .B mhn -checks this by examining the environment -variable -.BR $MM_CHARSET . -If the value of this environment variable is equal +checks this by examining the current character set defined by the +.IR locale (1) +environment variables. +If the value of the locale character set is equal to the value of the charset parameter, then .B mhshow assumes it can -display this content without any additional setup. If this environment -variable is not set, +display this content without any additional setup. If the locale is not +set properly, .B mhshow will assume a value of \*(lqUS-ASCII\*(rq. If the character set cannot be displayed natively, then diff --git a/man/scan.man b/man/scan.man index b9c94f48..17a702ca 100644 --- a/man/scan.man +++ b/man/scan.man @@ -73,9 +73,12 @@ these scan listings. .B Scan will only decode these fields if your terminal can natively display the character set used in the encoding. -You should set the MM_CHARSET environment variable to your native -character set, if it is not US-ASCII. See the mh-profile(5) man -page for details about this environment variable. +You should set the appropriate +.IR locale (1) +environment variables to your native +character set, if it is not US-ASCII. See +.IR locale (1) +for more details on the appropriate environment variables. .PP The switch .BR \-reverse , diff --git a/man/show.man b/man/show.man index c69a7d75..04589fb6 100644 --- a/man/show.man +++ b/man/show.man @@ -92,14 +92,15 @@ specify a transfer encoding (such as MIME quoted-printable or base64) or specify a character set that .B show doesn't believe -can be displayed natively. The environment variable -.B $MM_CHARSET +can be displayed natively. The appropriate +.IR locale (1) +environment variables should be set to the terminal's native character set to avoid gratuitous invocations of the .IR showmimeproc . See the -.IR mh-profile (5) -man page for details about this environment variable. +.IR locale (1) +man page for details about these environment variables. .PP The option .B \-checkmime diff --git a/sbr/check_charset.c b/sbr/check_charset.c index e43459ef..4f2eeba9 100644 --- a/sbr/check_charset.c +++ b/sbr/check_charset.c @@ -8,9 +8,8 @@ */ #include -#ifdef HAVE_LANGINFO_H -# include -#endif + +#include /* @@ -19,12 +18,7 @@ char * get_charset () { - char *charset = getenv ("MM_CHARSET"); -#if defined(HAVE_NL_LANGINFO) && defined(CODESET) - if (!charset) - charset = norm_charmap(nl_langinfo (CODESET)); -#endif - return charset; + return norm_charmap(nl_langinfo (CODESET)); } diff --git a/test/common.sh.in b/test/common.sh.in index 13db440a..be8b25df 100644 --- a/test/common.sh.in +++ b/test/common.sh.in @@ -23,7 +23,7 @@ test -z "$MH_INST_DIR" && MH_INST_DIR="${MH_TEST_DIR}/inst" export MH_INST_DIR unset MHBUILD MHCONTEXT MHMTSUSERCONF MHN MHSHOW MHSTORE -unset MHLDEBUG MHPDEBUG MHWDEBUG MM_CHARSET PAGER +unset MHLDEBUG MHPDEBUG MHWDEBUG PAGER #### Use a test dir for tmp files when MHTMPDIR applies. MHTMPDIR=$MH_TEST_DIR/Mail diff --git a/test/scan/test-scan-multibyte b/test/scan/test-scan-multibyte index c78a4d2e..76b0a8c7 100755 --- a/test/scan/test-scan-multibyte +++ b/test/scan/test-scan-multibyte @@ -104,7 +104,7 @@ if test "$ICONV_ENABLED" -eq 1; then EOF # Don't use run_prog here because it loses those environment settings. - LC_CTYPE=ISO-8859-1 MM_CHARSET=ISO-8859-1 scan -width 75 last >"$actual" + LC_ALL=en_US.ISO8859-1 scan -width 75 last >"$actual" check "$expected" "$actual" fi @@ -132,12 +132,12 @@ else echo "Unsupported width for U+2019: $width" fi -LC_CTYPE=en_US.UTF-8 MM_CHARSET=UTF-8 scan -width 75 last >"$actual" +LC_ALL=en_US.UTF-8 scan -width 75 last >"$actual" check "$expected" "$actual" cat >"$expected" <"${MH_TEST_DIR}/Mail/inbox/13" <"$actual" +LC_ALL=en_US.ISO8859-1 scan -width 80 last >"$actual" check "$expected" "$actual"