office-gobmx/external/boost/boost.between.warning.patch
Michael Meeks 1eab80a049 boost / gettext warning improvement.
std::runtime_exception of:
	"Invalid or unsupported charset:UTF-8 or UTF-8"

is less useful than it could be when spat out from the boost gettext
impl. Survive for the next (and probably more useful) exception.

Change-Id: Ibeb60b4a34f09f47051844c3e8048f38618d0e05
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129566
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2022-02-07 19:44:50 +01:00

13 lines
702 B
Diff

diff -ru boost.orig/boost/libs/locale/src/encoding/codepage.cpp boost/boost/libs/locale/src/encoding/codepage.cpp
--- foo/misc/boost.orig/libs/locale/src/encoding/codepage.cpp
+++ foo/misc/boost/libs/locale/src/encoding/codepage.cpp
@@ -58,6 +58,9 @@
return cvt->convert(begin,end);
#endif
#endif
+ // ensures we get a sensible warning in boost's gettext results about a real mismatch.
+ if (to_charset && from_charset && !strcmp(to_charset, from_charset))
+ return std::string(begin, end - begin);
throw invalid_charset_error(std::string(to_charset) + " or " + from_charset);
}