Pay attention to coding when using the system function

windows

I use system( "7x x 含有中文.zip" )still can not find the file decompression

ERROR: 系统找不到指定的文件。

“含有中文.zip”It is UTF-8 encoding, and windows mainly uses two types of encoding, UNICODE (utf-16) and code page 1 2

If China uses cp936 encoding,
Japanese uses cp932 encoding

UTF-8 is not supported

So we have to convert the code

Or use Unicode functions (recommended)

So from the recommendation to use _T macro, no matter what



  1. https://docs.microsoft.com/zh-cn/cpp/text/unicode-and-mbcs?view=vs-2019 ↩︎

  2. https://baike.baidu.com/item/%E4%BB%A3%E7%A0%81%E9%A1%B5/11025504?fr=aladdin ↩︎

Published 36 original articles · won praise 1 · views 8965

Guess you like

Origin blog.csdn.net/u011091701/article/details/104458823