From 66475732af3fd595fe9060d7e3c19bc4deaa6397 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Sun, 20 Sep 2020 15:05:49 +0200 Subject: [PATCH] Fix str2wcs for LANG=C 4f0ade7a73f277927a58d87d46c48c33b331cc2b broke the tests when LANG was C, so the MB_CUR_MAX==1 path wasn't working. Seemingly that cast is doing some work here? Just revert that bit for now, since this path is unimportant anyway (please, please, please, please use a unicode capable locale). --- src/common.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common.cpp b/src/common.cpp index 5bcbbc5ac..19cec8bc6 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -315,7 +315,11 @@ static wcstring str2wcs_internal(const char *in, const size_t in_len) { // In the unlikely event that MB_CUR_MAX is 1, then we are just going to append. if (MB_CUR_MAX == 1) { - result.insert(result.end(), in, in + in_len); + size_t in_pos = 0; + while (in_pos < in_len) { + result.push_back(static_cast(in[in_pos])); + in_pos++; + } return result; }