[Bug 216372] [patch] devel/icu: turn on same workaround as for Linux to fix incorrect detection UTF-8 locale in some applications
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Sun Jan 22 15:35:37 UTC 2017
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216372
Bug ID: 216372
Summary: [patch] devel/icu: turn on same workaround as for
Linux to fix incorrect detection UTF-8 locale in some
applications
Product: Ports & Packages
Version: Latest
Hardware: Any
OS: Any
Status: New
Keywords: patch
Severity: Affects Many People
Priority: ---
Component: Individual Port(s)
Assignee: office at FreeBSD.org
Reporter: vvd at unislabs.com
Flags: maintainer-feedback?(office at FreeBSD.org)
Assignee: office at FreeBSD.org
Keywords: patch
For example net-im/qTox and gwenview5.
More information is here:
http://bugs.icu-project.org/trac/ticket/12886
https://bugreports.qt.io/browse/QTBUG-57522
https://github.com/qTox/qTox/issues/4012#issuecomment-273962027
This patch was tested for net-im/qTox:
--- common/putil.cpp.orig 2016-10-19 17:20:56 UTC
+++ common/putil.cpp
@@ -1813,6 +1813,31 @@
/* Remap CP949 to a similar codepage to avoid issues with backslash
and won symbol. */
name = "EUC-KR";
}
+ if (locale != NULL && uprv_strcmp(name, "euc") == 0) {
+ /* Linux underspecifies the "EUC" name. */
+ if (uprv_strcmp(locale, "korean") == 0) {
+ name = "EUC-KR";
+ }
+ else if (uprv_strcmp(locale, "japanese") == 0) {
+ /* See comment below about eucJP */
+ name = "eucjis";
+ }
+ }
+ else if (uprv_strcmp(name, "eucjp") == 0) {
+ /*
+ ibm-1350 is the best match, but unavailable.
+ ibm-954 is mostly a superset of ibm-1350.
+ ibm-33722 is the default for eucJP (similar to Windows).
+ */
+ name = "eucjis";
+ }
+ else if (locale != NULL && uprv_strcmp(locale, "en_US_POSIX") != 0 &&
+ (uprv_strcmp(name, "ANSI_X3.4-1968") == 0 || uprv_strcmp(name,
"US-ASCII") == 0)) {
+ /*
+ * For non C/POSIX locale, default the code page to UTF-8 instead of
US-ASCII.
+ */
+ name = "UTF-8";
+ }
#elif U_PLATFORM == U_PF_HPUX
if (locale != NULL && uprv_strcmp(locale, "zh_HK") == 0 &&
uprv_strcmp(name, "big5") == 0) {
/* HP decided to extend big5 as hkbig5 even though it's not compatible
:-( */
@@ -1942,7 +1967,7 @@
nl_langinfo may use the same buffer as setlocale. */
{
const char *codeset = nl_langinfo(U_NL_LANGINFO_CODESET);
-#if U_PLATFORM_IS_DARWIN_BASED || U_PLATFORM_IS_LINUX_BASED
+#if U_PLATFORM_IS_DARWIN_BASED || U_PLATFORM_IS_LINUX_BASED || U_PLATFORM ==
U_PF_BSD
/*
* On Linux and MacOSX, ensure that default codepage for non C/POSIX
locale is UTF-8
* instead of ASCII.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-office
mailing list