OK, I solved it myself. I need to save the file with byte order mark, and then MSVC correctly recognized that it is encoded in UTF-8 and everything works fine.
Update: on newer MSVC we can set the compiler option /utf-8
and not bother with the BOM.