Bug 175440 - [PATCH] Fix ports/japanese/less's behavior with LANG=ja_JP.UTF-8
Summary: [PATCH] Fix ports/japanese/less's behavior with LANG=ja_JP.UTF-8
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Hiroki Sato
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-19 20:30 UTC by Norikatsu Shigemura
Modified: 2013-01-20 01:30 UTC (History)
0 users

See Also:


Attachments
file.diff (1.47 KB, patch)
2013-01-19 20:30 UTC, Norikatsu Shigemura
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Norikatsu Shigemura freebsd_committer freebsd_triage 2013-01-19 20:30:00 UTC
In case of not defined JLESSCHARSET enviroment value,
jless looks LANG enviroment value, and make a decision
on JLESSCHARSET from LANG.

If LANG has UTF-8/UTF8 keyword, so jless assumes JLESSCHARSET=utf8.
But we hope to assume JLESSCHARSET=japanese-utf8 if LANG=ja_JP.UTF-8.

Fix: To fix decision order, please apply attached my patch.

Patch attached with submission follows:
How-To-Repeat: On UTF-8 console:

OK$ env LANG=ja_JP.UTF-8 JLESSCHARSET=japanese-utf8 jless eucjp-file utf8-file
NG$ env LANG=ja_JP.UTF-8 JLESSCHARSET=utf8 jless eucjp-file utf8-file
NG$ env LANG=ja_JP.UTF-8 jless eucjp-file utf8-file
Comment 1 Hiroki Sato freebsd_committer freebsd_triage 2013-01-20 01:29:29 UTC
State Changed
From-To: open->closed

Committed, thanks! 


Comment 2 Hiroki Sato freebsd_committer freebsd_triage 2013-01-20 01:29:29 UTC
Responsible Changed
From-To: freebsd-ports-bugs->hrs

Committed, thanks!
Comment 3 dfilter service freebsd_committer freebsd_triage 2013-01-20 01:29:34 UTC
Author: hrs
Date: Sun Jan 20 01:29:21 2013
New Revision: 310668
URL: http://svnweb.freebsd.org/changeset/ports/310668

Log:
  - Use UTF-8 when LANG=ja.JP.UTF-8.
  - Add README.ext.jp.
  
  Submitted by:	nork
  PR:		ports/175440

Added:
  head/japanese/less/files/patch-charset.c   (contents, props changed)
Modified:
  head/japanese/less/Makefile
Directory Properties:
  head/japanese/less/pkg-plist   (props changed)

Modified: head/japanese/less/Makefile
==============================================================================
--- head/japanese/less/Makefile	Sat Jan 19 22:47:03 2013	(r310667)
+++ head/japanese/less/Makefile	Sun Jan 20 01:29:21 2013	(r310668)
@@ -3,7 +3,7 @@
 
 PORTNAME=	less+iso
 PORTVERSION=	382.262
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	japanese
 MASTER_SITES=	${MASTER_SITE_LOCAL}
 MASTER_SITE_SUBDIR=	nork
@@ -33,7 +33,7 @@ CONFIGURE_ARGS=	--with-cs-regex
 MAN1=		jless.1 jlesskey.1
 DOCSDIR=	${PREFIX}/share/doc/less
 PORTDOCS=	README.iso README.iso.jp README.lesw.euc \
-		README.regex README.regex.jp
+		README.regex README.regex.jp README.ext.jp
 
 post-extract:
 	cd ${WRKDIR} && \

Added: head/japanese/less/files/patch-charset.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/japanese/less/files/patch-charset.c	Sun Jan 20 01:29:21 2013	(r310668)
@@ -0,0 +1,41 @@
+--- charset.c.orig	2013-01-20 04:32:52.491037000 +0900
++++ charset.c	2013-01-20 05:05:01.106026675 +0900
+@@ -872,6 +872,18 @@
+ 		return;
+ 	}
+ 
++#if HAVE_LOCALE
++	/*
++	 * Use setlocale.
++	 */
++	ilocale();
++#else
++#if MSDOS_COMPILER
++	/*
++	 * Default to "dos".
++	 */
++	(void) icharset("dos");
++#else
+ #if HAVE_STRSTR
+ 	/*
+ 	 * Check whether LC_ALL, LC_CTYPE or LANG look like UTF-8 is used.
+@@ -888,19 +900,6 @@
+ 				return;
+ 	}
+ #endif
+-
+-#if HAVE_LOCALE
+-	/*
+-	 * Use setlocale.
+-	 */
+-	ilocale();
+-#else
+-#if MSDOS_COMPILER
+-	/*
+-	 * Default to "dos".
+-	 */
+-	(void) icharset("dos");
+-#else
+ 	/*
+ 	 * All variables are not defined either, default to DEFCHARSET.
+ 	 * DEFCHARSET is defined in defines.h.
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"