c++ - How do I search for end of line ('\n') in a UTF-8 text? -


i have c++ library provides i/o device interface (including implementation files). provides utf-8 string class. now, need read line iodevice. reason i'm mentioning library can't, example, open file std::ifstream , read using std::wbuffer_convert<std::codecvt_utf8<wchar_t>>. don't mind using stdlib (in fact, prefer it), need read line iodevice , return string.

now, specific question: if read file byte byte, safe assume byte value '\n' in fact new line symbol, , not trailing part of different multi-byte symbol?

is safe assume byte value '\n' in fact new line symbol, , not trailing part of different multi-byte symbol?

yes, in utf-8, ascii bytes not occur in non-ascii code points.


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -