So you’re better off accepting the edge cases problems that white space introduces considering the benefits outweighs the pain.
Or are you talking about SP preceding CR and/or LF?
See here for example: https://en.cppreference.com/w/c/string/byte/isspace
Or here for Unicode: https://en.wikipedia.org/wiki/Whitespace_character#Unicode
Thanks for the responses