Fix clang-format-vs to use characters position/count instead of the offset/length for Unicode Replacements

김태석 via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 20 19:10:30 PDT 2018


Internally view.TextBuffer use sequence of Unicode characters encoded using
UTF-16 and use characters position/count for manipulating text.

When formatting an ANSI text, Replacements offset/length is same with
position/count but not an Unicode.

So conversion needed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181021/1669e0e8/attachment.html>
-------------- next part --------------
#include <iostream>
#include <string>

int main( int argc, char* argv[ ] )
{
	std::string helloworld = "안녕, 세상!";

	for( int i=0; i<3; ++i )
	{
		std::cout << helloworld << std::endl;
	}

	return 0;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ClangFormatPackage.patch
Type: application/octet-stream
Size: 5047 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181021/1669e0e8/attachment.obj>


More information about the cfe-commits mailing list