How to read file which contains \uxxxx in vc++

后端 未结 4 1877
遇见更好的自我
遇见更好的自我 2020-12-12 00:14

I have txt file whose contents are:

\\u041f\\u0435\\u0440\\u0432\\u044b\\u0439_\\u0438\\u043d\\u0442\\u0435\\u0440\\u0430\\u043a\\u0442\\u0438\\u0432\

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-12 00:44

    It's not very easy when you're reading in the file. It's easier to do a post-processing step afterwards. You can use Boost::regex to look for the pattern "\u[0-9A-Fa-f]{4}", and replace that by the corresponding single character.

提交回复
热议问题