From f33c2530c7e0a9cae3b381a256dd6a7561ea07ee Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Mon, 25 Sep 2017 06:20:08 +0000 Subject: [PATCH] devel/boost-libs: improve lossy character encoding PR: 215393 --- devel/boost-libs/Makefile | 1 + .../patch-libs_locale_src_encoding_codepage.cpp | 58 ++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 devel/boost-libs/files/patch-libs_locale_src_encoding_codepage.cpp diff --git a/devel/boost-libs/Makefile b/devel/boost-libs/Makefile index 30da37ea6450..ba89ddc4371d 100644 --- a/devel/boost-libs/Makefile +++ b/devel/boost-libs/Makefile @@ -2,6 +2,7 @@ # $FreeBSD$ PORTNAME= boost-libs +PORTREVISION= 1 COMMENT= Free portable C++ libraries (without Boost.Python) diff --git a/devel/boost-libs/files/patch-libs_locale_src_encoding_codepage.cpp b/devel/boost-libs/files/patch-libs_locale_src_encoding_codepage.cpp new file mode 100644 index 000000000000..adc9e0a7730e --- /dev/null +++ b/devel/boost-libs/files/patch-libs_locale_src_encoding_codepage.cpp @@ -0,0 +1,58 @@ +Prefer ICU for better skip conversion policy + +--- libs/locale/src/encoding/codepage.cpp.orig 2017-09-02 09:56:14 UTC ++++ libs/locale/src/encoding/codepage.cpp +@@ -40,13 +40,13 @@ namespace boost { + method_type how) + { + std::auto_ptr cvt; +- #ifdef BOOST_LOCALE_WITH_ICONV +- cvt.reset(new iconv_between()); ++ #ifdef BOOST_LOCALE_WITH_ICU ++ cvt.reset(new uconv_between()); + if(cvt->open(to_charset,from_charset,how)) + return cvt->convert(begin,end); + #endif +- #ifdef BOOST_LOCALE_WITH_ICU +- cvt.reset(new uconv_between()); ++ #ifdef BOOST_LOCALE_WITH_ICONV ++ cvt.reset(new iconv_between()); + if(cvt->open(to_charset,from_charset,how)) + return cvt->convert(begin,end); + #endif +@@ -66,13 +66,13 @@ namespace boost { + method_type how) + { + std::auto_ptr > cvt; +- #ifdef BOOST_LOCALE_WITH_ICONV +- cvt.reset(new iconv_to_utf()); ++ #ifdef BOOST_LOCALE_WITH_ICU ++ cvt.reset(new uconv_to_utf()); + if(cvt->open(charset,how)) + return cvt->convert(begin,end); + #endif +- #ifdef BOOST_LOCALE_WITH_ICU +- cvt.reset(new uconv_to_utf()); ++ #ifdef BOOST_LOCALE_WITH_ICONV ++ cvt.reset(new iconv_to_utf()); + if(cvt->open(charset,how)) + return cvt->convert(begin,end); + #endif +@@ -92,13 +92,13 @@ namespace boost { + method_type how) + { + std::auto_ptr > cvt; +- #ifdef BOOST_LOCALE_WITH_ICONV +- cvt.reset(new iconv_from_utf()); ++ #ifdef BOOST_LOCALE_WITH_ICU ++ cvt.reset(new uconv_from_utf()); + if(cvt->open(charset,how)) + return cvt->convert(begin,end); + #endif +- #ifdef BOOST_LOCALE_WITH_ICU +- cvt.reset(new uconv_from_utf()); ++ #ifdef BOOST_LOCALE_WITH_ICONV ++ cvt.reset(new iconv_from_utf()); + if(cvt->open(charset,how)) + return cvt->convert(begin,end); + #endif