mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 14:03:58 +00:00
Remove mbrtowc_invalid_utf8.cpp
This was used in CMake to detect invalid mbrtowc implementations. The only known case was on SnowLeopard, which is no longer supported. Remove this file.
This commit is contained in:
parent
0f56db55a2
commit
509d4fa122
1 changed files with 0 additions and 18 deletions
|
@ -1,18 +0,0 @@
|
||||||
#include <cstdio>
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <cstring>
|
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
// Check whether the runtime mbrtowc implementation attempts to encode
|
|
||||||
// invalid UTF-8 values.
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
// TODO: I'm not sure how to enforce a UTF-8 locale without overriding the language
|
|
||||||
char sample[] = "hello world";
|
|
||||||
sample[0] |= 0xF8;
|
|
||||||
wchar_t wsample[100] {};
|
|
||||||
std::mbstate_t state = std::mbstate_t();
|
|
||||||
int res = std::mbrtowc(wsample, sample, strlen(sample), &state);
|
|
||||||
|
|
||||||
return res < 0 ? 0 : 1;
|
|
||||||
}
|
|
Loading…
Reference in a new issue