The trace error occurs in the first line of the function, "_ asserte (unsigned) (C + 1) <= 256 );"
The explanation on the internet is:
I tried to use the isspace where locale is ASCII to determine GBK as a Chinese-encoded space, right? If I understand it correctly, this is not a VC issue, but a usage issue.
For C ++, isspace (CH, Loc) should be used. In this version, Loc is a variable of the type STD: locale. If you want to judge the space of GBK, so let loc be the locale of GBK, and then this function will be normal.
You are currently using the C isspace (CH) function. This function uses the default global locale. You can set this global function to GBK and solve this problem. In short, the isspace of locale, which is the default ASCII, is called to determine whether the string encoded as GBK is a space. The logic is incorrect.
The solution is to set encoding localization before calling this function,CodeAs follows:
STD: locale: Global (STD: locale (""));
In fact, the solution is the same as the fstream localization path.