Skip to content

Commit 2eb7898

Browse files
committed
Handle 8-bit characters under LOCALE=C
Even when the character set is specified as ASCII, we should handle data outside the 7-bit range gracefully by simply copying it, even if it is technically no longer ASCII. This fixes several of Git for Windows' tests, e.g. t7400. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent dc3cc3e commit 2eb7898

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

winsup/cygwin/strfuncs.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,11 @@ _sys_mbstowcs (mbtowc_p f_mbtowc, wchar_t *dst, size_t dlen, const char *src,
11461146
to store them in a symmetric way. */
11471147
bytes = 1;
11481148
if (dst)
1149+
#ifdef STRICTLY_7BIT_ASCII
11491150
*ptr = L'\xf000' | *pmbs;
1151+
#else
1152+
*ptr = *pmbs;
1153+
#endif
11501154
memset (&ps, 0, sizeof ps);
11511155
}
11521156

0 commit comments

Comments
 (0)