Open karyon opened 7 years ago
So you suggest and vote for creating a unicode-aware fallback. Although I find unicode code slightly strange (and so is this comment above), I am pro UTF-8 encoded source code files. I also think the fallback implementation should be able to handle all cases the driver hasn't implemented (yet).
Is the isspace
call the only non-unicode handling code or would a fix here imply many other fixes to get actually useful?
Can you provide a pull request?
no idea whether other fixes are needed. i cannot provide a pull request at least until next year.
Could be possible to solve the issue including a specific locale as the second argument for std::is_space? Like:
auto wsfront =
std::find_if_not(s.begin(), s.end(), [](int c) { return std::isspace(c, std::locale("en_US.UTF8")); } );
this line here https://github.com/cginternals/globjects/blob/17dcc4c5129259781bdb9251294518f2a0c75472/source/globjects/source/IncludeProcessor.cpp#L24
was failing for me in debug mode when processing a line that had this comment inside it:
this is also mentioned in the comments of the linked stackoverflow post.