{"id":127,"date":"2015-05-18T12:02:21","date_gmt":"2015-05-18T12:02:21","guid":{"rendered":""},"modified":"2015-05-18T12:02:21","modified_gmt":"2015-05-18T12:02:21","slug":"","status":"publish","type":"post","link":"http:\/\/weizn.net\/?p=127","title":{"rendered":"Qt\u4e0bQString\u8f6cchar*"},"content":{"rendered":"<div id=\"cnblogs_post_body\">\n<p>\n\t\tQt\u4e0b\u9762\uff0c\u5b57\u7b26\u4e32\u90fd\u7528QString\uff0c\u786e\u5b9e\u7ed9\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u65b9\u4fbf\uff0c\u60f3\u60f3VC\u91cc\u9762\u5b9a\u4e49\u7684\u5404\u79cd\u53d8\u91cf\u7c7b\u578b\uff0c\u800c\u4e14\u51fd\u6570\u53c2\u6570\u7c7b\u578b\u4e94\u82b1\u516b\u95e8\uff0c\u7ecf\u5e38\u9700\u8981\u4eca\u5e74\u65b0\u90a3\u4e2a\u7c7b\u578b\u8f6c\u6362\n\t<\/p>\n<p>\n\t\tQt\u518d\u4f7f\u7528\u7b2c\u4e09\u65b9\u5f00\u6e90\u5e93\u65f6\uff0c\u7531\u4e8e\u5e93\u7684\u7c7b\u578b\u57fa\u672c\u4e0a\u90fd\u662f\u6807\u51c6\u7684\u7c7b\u578b\uff0c\u5b57\u7b26\u4e32\u9047\u7684\u591a\u7684\u5c31\u662fChar*\u7c7b\u578b\n\t<\/p>\n<p>\n\t\t\u5728Qt\u4e0b\u600e\u6837\u5c06QString\u8f6cchar*\u5462\uff0c\u9700\u8981\u7528\u5230QByteArray\u7c7b\uff0cQByteArray\u7c7b\u7684\u8bf4\u660e\u8be6\u89c1Qt\u5e2e\u52a9\u6587\u6863\u3002\n\t<\/p>\n<p>\n\t\t\u56e0\u4e3achar*\u6700\u540e\u90fd\u6709\u4e00\u4e2a\u2018\/0\u2019\u4f5c\u4e3a\u7ed3\u675f\u7b26\uff0c\u800c\u91c7\u7528QString::toLatin1()\u65f6\u4f1a\u5728\u5b57\u7b26\u4e32\u540e\u9762\u52a0\u4e0a\u2018\/0\u2019\n\t<\/p>\n<p>\n\t\t\u65b9\u6cd5\u5982\u4e0b\uff1a\n\t<\/p>\n<p>\n\t\tQstring&nbsp; str;\n\t<\/p>\n<p>\n\t\tchar*&nbsp; ch;\n\t<\/p>\n<p>\n\t\tQByteArray ba = str.toLatin1(); &nbsp; &nbsp;\n\t<\/p>\n<p>\n\t\tch=ba.data();\n\t<\/p>\n<p>\n\t\t\u8fd9\u6837\u5c31\u5b8c\u6210\u4e86QString\u5411char*\u7684\u8f6c\u5316\u3002\u7ecf\u6d4b\u8bd5\u7a0b\u5e8f\u8fd0\u884c\u65f6\u4e0d\u4f1a\u51fa\u73b0bug\n\t<\/p>\n<p>\n\t\t<span style=\"color:#000000;\">\u7528toLatin1\u597d\u50cf\u4e0d\u652f\u6301\u4e2d\u6587\uff0c\u7528toLocal8Bit\u53ef\u4ee5\u652f\u6301\u3002<\/span>\n\t<\/p>\n<p>\n\t\t<span style=\"color:#ff0000;\">\u6ce8\u610f\u7b2c\u4e09\u884c\uff0c\u4e00\u5b9a\u8981\u52a0\u4e0a\uff0c\u4e0d\u53ef\u4ee5str.toLatin1().data()\u8fd9\u6837\u4e00\u90e8\u5b8c\u6210\uff0c\u53ef\u80fd\u4f1a\u51fa\u9519\u3002<\/span>\n\t<\/p>\n<p>\n\t\t&nbsp;\n\t<\/p>\n<p>\n\t\t<span style=\"color:#ff0000;\">\u8865\u5145\uff1a\u4ee5\u4e0a\u65b9\u6cd5\u5f53QString\u91cc\u4e0d\u542b\u4e2d\u6587\u65f6\uff0c\u6ca1\u6709\u95ee\u9898\uff0c\u4f46\u662fQString\u5185\u542b\u6709\u4e2d\u6587\u65f6\uff0c\u8f6c\u6362\u4e3achar*\u5c31\u662f\u4e71\u7801\uff0c\u91c7\u7528\u5982\u4e0b\u65b9\u6cd5\u89e3\u51b3\uff1a<\/span>\n\t<\/p>\n<p>\n\t\t<span style=\"color:#000080;\">\u65b9\u6cd51\uff1a<\/span>\n\t<\/p>\n<p>\n\t\t\u6dfb\u52a0GBK\u7f16\u7801\u652f\u6301\uff1a\n\t<\/p>\n<p>\n\t\t#include &lt;QTextCodec&gt;\n\t<\/p>\n<p>\n\t\tQTextCodec::setCodecForTr(QTextCodec::codecForName(&#8220;GBK&#8221;));<br \/>\nQTextCodec::setCodecForLocale(QTextCodec::codecForName(&#8220;GBK&#8221;));\n\t<\/p>\n<p>\n\t\t\u7136\u540e\u6539\u53d8\u4e0a\u9762\u7684\u7b2c\u4e09\u884c\u4e3a\uff1aQByteArray ba = str.toLoacl8Bit(); &nbsp; &nbsp; &nbsp;toLoacl8Bit\u652f\u6301\u4e2d\u6587\n\t<\/p>\n<p>\n\t\t<span style=\"color:#000080;\">\u65b9\u6cd52\uff1a<\/span>\n\t<\/p>\n<p>\n\t\t\u5148\u5c06QString\u8f6c\u4e3a\u6807\u51c6\u5e93\u4e2d\u7684string\u7c7b\u578b\uff0c\u7136\u540e\u5c06string\u8f6c\u4e3achar*\uff0c\u5982\u4e0b\uff1a\n\t<\/p>\n<p>\n\t\tstd::string str = filename.toStdString();\n\t<\/p>\n<p>\n\t\tconst char* ch = str.c_str();\n\t<\/p>\n<p>\n\t\t&nbsp;\n\t<\/p>\n<p>\n\t\t\u6211\u5e38\u7528\u7684\u65b9\u6cd5\uff1a\n\t<\/p>\n<p><span style=\"color:#808000;\">char<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#000000;\">QString_to_char<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#800080;\">QString<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">qstring<\/span><span style=\"color:#000000;\">)<\/span> <\/p>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#000000;\">{<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">char<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#000000;\">str<\/span><span style=\"color:#000000;\">=<\/span><span style=\"color:#000080;\">NULL<\/span><span style=\"color:#000000;\">;<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;-qt-paragraph-type:empty;\"><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#800080;\">std<\/span><span style=\"color:#000000;\">::<\/span><span style=\"color:#800080;\">string<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">str2<\/span><span style=\"color:#000000;\">=<\/span><span style=\"color:#000000;\">qstring<\/span><span style=\"color:#000000;\">.<\/span><span style=\"color:#000000;\">toStdString<\/span><span style=\"color:#000000;\">();<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;-qt-paragraph-type:empty;\"><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">str<\/span><span style=\"color:#000000;\">=(<\/span><span style=\"color:#808000;\">char<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">*)<\/span><span style=\"color:#000000;\">malloc<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#000000;\">str2<\/span><span style=\"color:#000000;\">.<\/span><span style=\"color:#000000;\">size<\/span><span style=\"color:#000000;\">()+<\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#000000;\">);<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">if<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#000000;\">str<\/span><span style=\"color:#000000;\">==<\/span><span style=\"color:#000080;\">NULL<\/span><span style=\"color:#000000;\">)<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">return<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">NULL<\/span><span style=\"color:#000000;\">;<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">memset<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#000000;\">str<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#000080;\">NULL<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#000000;\">str2<\/span><span style=\"color:#000000;\">.<\/span><span style=\"color:#000000;\">size<\/span><span style=\"color:#000000;\">()+<\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#000000;\">);<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">strcat<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#000000;\">str<\/span><span style=\"color:#000000;\">,(<\/span><span style=\"color:#808000;\">char<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">*)<\/span><span style=\"color:#000000;\">str2<\/span><span style=\"color:#000000;\">.<\/span><span style=\"color:#000000;\">data<\/span><span style=\"color:#000000;\">());<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;-qt-paragraph-type:empty;\"><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">return<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">str<\/span><span style=\"color:#000000;\">;<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#000000;\">}<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#000000;\">\u4e0d\u8fc7\u8f6c\u6362\u540e\u4e8bUTF-8\u7f16\u7801\u7684\uff0c\u53ef\u4ee5\u518d\u8f6c\u6362\u4e3a\u5176\u5b83\u7f16\u7801\u683c\u5f0f\uff1a<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#000000;\"><span style=\"color:#808000;\">wchar_t<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">ANSIToUnicode<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">const<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">char<\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">str<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">)<\/span> \r\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#000000;\">{<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">int<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">textlen<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">;<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">wchar_t<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">result<\/span><span style=\"color:#000000;\">;<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">textlen<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">=<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">MultiByteToWideChar<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">CP_ACP<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">0<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">str<\/span><span style=\"color:#000000;\">,-<\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">NULL<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#000080;\">0<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">);<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">result<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">=<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#808000;\">wchar_t<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">*)<\/span><span style=\"color:#000000;\">malloc<\/span><span style=\"color:#000000;\">((<\/span><span style=\"color:#000000;\">textlen<\/span><span style=\"color:#000000;\">+<\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#000000;\">)*<\/span><span style=\"color:#808000;\">sizeof<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#808000;\">wchar_t<\/span><span style=\"color:#000000;\">));<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">memset<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#000000;\">result<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#000080;\">0<\/span><span style=\"color:#000000;\">,(<\/span><span style=\"color:#000000;\">textlen<\/span><span style=\"color:#000000;\">+<\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#000000;\">)*<\/span><span style=\"color:#808000;\">sizeof<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#808000;\">wchar_t<\/span><span style=\"color:#000000;\">));<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">MultiByteToWideChar<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#000080;\">CP_ACP<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">0<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#000000;\">str<\/span><span style=\"color:#000000;\">,-<\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#000000;\">,(<\/span><span style=\"color:#800080;\">LPWSTR<\/span><span style=\"color:#000000;\">)<\/span><span style=\"color:#000000;\">result<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#000000;\">textlen<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">);<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">return<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">result<\/span><span style=\"color:#000000;\">;<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#000000;\">}<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;-qt-paragraph-type:empty;\"><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#808000;\">char<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">UnicodeToANSI<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">const<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">wchar_t<\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">str<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">)<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#000000;\">{<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">char<\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">result<\/span><span style=\"color:#000000;\">;<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">int<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">textlen<\/span><span style=\"color:#000000;\">;<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">textlen<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">=<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">WideCharToMultiByte<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">CP_ACP<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">0<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">str<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">-<\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">NULL<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">0<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">NULL<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">NULL<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">);<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">result<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">=(<\/span><span style=\"color:#808000;\">char<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">*)<\/span><span style=\"color:#000000;\">malloc<\/span><span style=\"color:#000000;\">((<\/span><span style=\"color:#000000;\">textlen<\/span><span style=\"color:#000000;\">+<\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#000000;\">)*<\/span><span style=\"color:#808000;\">sizeof<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#808000;\">char<\/span><span style=\"color:#000000;\">));<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">memset<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">result<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">0<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">sizeof<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#808000;\">char<\/span><span style=\"color:#000000;\">)<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">textlen<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">+<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">)<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">);<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">WideCharToMultiByte<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">CP_ACP<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">0<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">str<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">-<\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">result<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">textlen<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">NULL<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">NULL<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">);<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">return<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">result<\/span><span style=\"color:#000000;\">;<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#000000;\">}<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;-qt-paragraph-type:empty;\"><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#808000;\">wchar_t<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">UTF8ToUnicode<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">const<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">char<\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">str<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">)<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#000000;\">{<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">int<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">textlen<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">;<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">wchar_t<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">result<\/span><span style=\"color:#000000;\">;<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">textlen<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">=<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">MultiByteToWideChar<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">CP_UTF8<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">0<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">str<\/span><span style=\"color:#000000;\">,-<\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">NULL<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#000080;\">0<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">);<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">result<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">=<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#808000;\">wchar_t<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">*)<\/span><span style=\"color:#000000;\">malloc<\/span><span style=\"color:#000000;\">((<\/span><span style=\"color:#000000;\">textlen<\/span><span style=\"color:#000000;\">+<\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#000000;\">)*<\/span><span style=\"color:#808000;\">sizeof<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#808000;\">wchar_t<\/span><span style=\"color:#000000;\">));<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">memset<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#000000;\">result<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#000080;\">0<\/span><span style=\"color:#000000;\">,(<\/span><span style=\"color:#000000;\">textlen<\/span><span style=\"color:#000000;\">+<\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#000000;\">)*<\/span><span style=\"color:#808000;\">sizeof<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#808000;\">wchar_t<\/span><span style=\"color:#000000;\">));<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">MultiByteToWideChar<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#000080;\">CP_UTF8<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">0<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#000000;\">str<\/span><span style=\"color:#000000;\">,-<\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#000000;\">,(<\/span><span style=\"color:#800080;\">LPWSTR<\/span><span style=\"color:#000000;\">)<\/span><span style=\"color:#000000;\">result<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#000000;\">textlen<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">);<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">return<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">result<\/span><span style=\"color:#000000;\">;<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#000000;\">}<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;-qt-paragraph-type:empty;\"><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#808000;\">char<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">UnicodeToUTF8<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">const<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">wchar_t<\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">str<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">)<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#000000;\">{<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">char<\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">result<\/span><span style=\"color:#000000;\">;<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">int<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">textlen<\/span><span style=\"color:#000000;\">;<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">textlen<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">=<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">WideCharToMultiByte<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">CP_UTF8<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">0<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">str<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">-<\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">NULL<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">0<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">NULL<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">NULL<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">);<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">result<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">=(<\/span><span style=\"color:#808000;\">char<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">*)<\/span><span style=\"color:#000000;\">malloc<\/span><span style=\"color:#000000;\">((<\/span><span style=\"color:#000000;\">textlen<\/span><span style=\"color:#000000;\">+<\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#000000;\">)*<\/span><span style=\"color:#808000;\">sizeof<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#808000;\">char<\/span><span style=\"color:#000000;\">));<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">memset<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#000000;\">result<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">0<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">sizeof<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#808000;\">char<\/span><span style=\"color:#000000;\">)<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">textlen<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">+<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">)<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">);<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">WideCharToMultiByte<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">CP_UTF8<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">0<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">str<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">-<\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">result<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">textlen<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">NULL<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">NULL<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">);<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">return<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">result<\/span><span style=\"color:#000000;\">;<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#000000;\">}<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;-qt-paragraph-type:empty;\"><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#008000;\">\/*\u5bbd\u5b57\u7b26\u8f6c\u6362\u4e3a\u591a\u5b57\u7b26Unicode<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#008000;\">-<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#008000;\">ANSI*\/<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;-qt-paragraph-type:empty;\"><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#808000;\">char<\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">w2m<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#808000;\">const<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">wchar_t<\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">wcs<\/span><span style=\"color:#000000;\">)<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#000000;\">{<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">int<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">len<\/span><span style=\"color:#000000;\">;<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">char<\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">buf<\/span><span style=\"color:#000000;\">;<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">len<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">=<\/span><span style=\"color:#000000;\">wcstombs<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#000080;\">NULL<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#000000;\">wcs<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#000080;\">0<\/span><span style=\"color:#000000;\">);<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">if<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#000000;\">len<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">==<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">0<\/span><span style=\"color:#000000;\">)<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">return<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">NULL<\/span><span style=\"color:#000000;\">;<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">buf<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">=<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#808000;\">char<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">*)<\/span><span style=\"color:#000000;\">malloc<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#808000;\">sizeof<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#808000;\">char<\/span><span style=\"color:#000000;\">)*(<\/span><span style=\"color:#000000;\">len<\/span><span style=\"color:#000000;\">+<\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#000000;\">));<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">memset<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#000000;\">buf<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">0<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">sizeof<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#808000;\">char<\/span><span style=\"color:#000000;\">)<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">*(<\/span><span style=\"color:#000000;\">len<\/span><span style=\"color:#000000;\">+<\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#000000;\">));<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">len<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">=<\/span><span style=\"color:#000000;\">wcstombs<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#000000;\">buf<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#000000;\">wcs<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#000000;\">len<\/span><span style=\"color:#000000;\">+<\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#000000;\">);<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">return<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">buf<\/span><span style=\"color:#000000;\">;<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#000000;\">}<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;-qt-paragraph-type:empty;\"><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#008000;\">\/*\u591a\u5b57\u7b26\u8f6c\u6362\u4e3a\u5bbd\u5b57\u7b26ANSI<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#008000;\">-<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#008000;\">Unicode*\/<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;-qt-paragraph-type:empty;\"><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#808000;\">wchar_t<\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">m2w<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#808000;\">const<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">char<\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">mbs<\/span><span style=\"color:#000000;\">)<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#000000;\">{<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">int<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">len<\/span><span style=\"color:#000000;\">;<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">wchar_t<\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">buf<\/span><span style=\"color:#000000;\">;<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">len<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">=<\/span><span style=\"color:#000000;\">mbstowcs<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#000080;\">NULL<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#000000;\">mbs<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#000080;\">0<\/span><span style=\"color:#000000;\">);<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">if<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#000000;\">len<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">==<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">0<\/span><span style=\"color:#000000;\">)<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">return<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">NULL<\/span><span style=\"color:#000000;\">;<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">buf<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">=<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#808000;\">wchar_t<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">*)<\/span><span style=\"color:#000000;\">malloc<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#808000;\">sizeof<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#808000;\">wchar_t<\/span><span style=\"color:#000000;\">)*(<\/span><span style=\"color:#000000;\">len<\/span><span style=\"color:#000000;\">+<\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#000000;\">));<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">memset<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#000000;\">buf<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000080;\">0<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">sizeof<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#808000;\">wchar_t<\/span><span style=\"color:#000000;\">)<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">*(<\/span><span style=\"color:#000000;\">len<\/span><span style=\"color:#000000;\">+<\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#000000;\">));<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">len<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">=<\/span><span style=\"color:#000000;\">mbstowcs<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#000000;\">buf<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#000000;\">mbs<\/span><span style=\"color:#000000;\">,<\/span><span style=\"color:#000000;\">len<\/span><span style=\"color:#000000;\">+<\/span><span style=\"color:#000080;\">1<\/span><span style=\"color:#000000;\">);<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">return<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">buf<\/span><span style=\"color:#000000;\">;<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#000000;\">}<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;-qt-paragraph-type:empty;\"><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#808000;\">char<\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">ANSIToUTF8<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#808000;\">const<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">char<\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">str<\/span><span style=\"color:#000000;\">)<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#000000;\">{<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">return<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">UnicodeToUTF8<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#000000;\">ANSIToUnicode<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#000000;\">str<\/span><span style=\"color:#000000;\">));<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#000000;\">}<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;-qt-paragraph-type:empty;\"><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#808000;\">char<\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">UTF8ToANSI<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#808000;\">const<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">char<\/span><span style=\"color:#000000;\">*<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">str<\/span><span style=\"color:#000000;\">)<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#000000;\">{<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#808000;\">return<\/span><span style=\"color:#c0c0c0;\"> <\/span><span style=\"color:#000000;\">UnicodeToANSI<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#000000;\">UTF8ToUnicode<\/span><span style=\"color:#000000;\">(<\/span><span style=\"color:#000000;\">str<\/span><span style=\"color:#000000;\">));<\/span><\/pre>\n<pre style=\"text-indent:0px;margin:0px;-qt-block-indent:0;\"><span style=\"color:#000000;\">}<\/span><\/pre>\n<p><\/span><\/p>\n<p>\n\t\t&nbsp;\n\t<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<div id=\"cnblogs_post_body\">\n<p>\n\t\tQt\u4e0b\u9762\uff0c\u5b57\u7b26\u4e32\u90fd\u7528QString\uff0c\u786e\u5b9e\u7ed9\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u65b9\u4fbf\uff0c\u60f3\u60f3VC\u91cc\u9762\u5b9a\u4e49\u7684\u5404\u79cd\u53d8\u91cf\u7c7b\u578b\uff0c\u800c\u4e14\u51fd\u6570\u53c2\u6570\u7c7b\u578b\u4e94\u82b1\u516b\u95e8\uff0c\u7ecf\u5e38\u9700\u8981\u4eca\u5e74\u65b0\u90a3\u4e2a\u7c7b\u578b\u8f6c\u6362\n\t<\/p>\n<p>\n\t\tQt\u518d\u4f7f\u7528\u7b2c\u4e09\u65b9\u5f00\u6e90\u5e93\u65f6\uff0c\u7531\u4e8e\u5e93\u7684\u7c7b\u578b\u57fa\u672c\u4e0a\u90fd\u662f\u6807\u51c6\u7684\u7c7b\u578b\uff0c\u5b57\u7b26\u4e32\u9047\u7684\u591a\u7684\u5c31\u662fChar*\u7c7b\u578b\n\t<\/p>\n<p>\n\t\t\u5728Qt\u4e0b\u600e\u6837\u5c06QString\u8f6cchar*\u5462\uff0c\u9700\u8981\u7528\u5230QByteArray\u7c7b\uff0cQByteArray\u7c7b\u7684\u8bf4\u660e\u8be6\u89c1Qt\u5e2e\u52a9\u6587\u6863\u3002\n\t<\/p>\n<p>\n\t\t&#8230;\n\t<\/p>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[331],"tags":[],"class_list":["post-127","post","type-post","status-publish","format-standard","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Qt\u4e0bQString\u8f6cchar* - Wayne&#039;s Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/weizn.net\/?p=127\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Qt\u4e0bQString\u8f6cchar* - Wayne&#039;s Blog\" \/>\n<meta property=\"og:description\" content=\"Qt\u4e0b\u9762\uff0c\u5b57\u7b26\u4e32\u90fd\u7528QString\uff0c\u786e\u5b9e\u7ed9\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u65b9\u4fbf\uff0c\u60f3\u60f3VC\u91cc\u9762\u5b9a\u4e49\u7684\u5404\u79cd\u53d8\u91cf\u7c7b\u578b\uff0c\u800c\u4e14\u51fd\u6570\u53c2\u6570\u7c7b\u578b\u4e94\u82b1\u516b\u95e8\uff0c\u7ecf\u5e38\u9700\u8981\u4eca\u5e74\u65b0\u90a3\u4e2a\u7c7b\u578b\u8f6c\u6362     Qt\u518d\u4f7f\u7528\u7b2c\u4e09\u65b9\u5f00\u6e90\u5e93\u65f6\uff0c\u7531\u4e8e\u5e93\u7684\u7c7b\u578b\u57fa\u672c\u4e0a\u90fd\u662f\u6807\u51c6\u7684\u7c7b\u578b\uff0c\u5b57\u7b26\u4e32\u9047\u7684\u591a\u7684\u5c31\u662fChar*\u7c7b\u578b     \u5728Qt\u4e0b\u600e\u6837\u5c06QString\u8f6cchar*\u5462\uff0c\u9700\u8981\u7528\u5230QByteArray\u7c7b\uff0cQByteArray\u7c7b\u7684\u8bf4\u660e\u8be6\u89c1Qt\u5e2e\u52a9\u6587\u6863\u3002     ...\" \/>\n<meta property=\"og:url\" content=\"http:\/\/weizn.net\/?p=127\" \/>\n<meta property=\"og:site_name\" content=\"Wayne&#039;s Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-05-18T12:02:21+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"zinan\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"http:\/\/weizn.net\/#website\",\"url\":\"http:\/\/weizn.net\/\",\"name\":\"Wayne&#039;s Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/weizn.net\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/weizn.net\/?p=127#webpage\",\"url\":\"http:\/\/weizn.net\/?p=127\",\"name\":\"Qt\\u4e0bQString\\u8f6cchar* - Wayne&#039;s Blog\",\"isPartOf\":{\"@id\":\"http:\/\/weizn.net\/#website\"},\"datePublished\":\"2015-05-18T12:02:21+00:00\",\"dateModified\":\"2015-05-18T12:02:21+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/weizn.net\/?p=127#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/weizn.net\/?p=127\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/weizn.net\/?p=127#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\\u9996\\u9875\",\"item\":\"http:\/\/weizn.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Qt\\u4e0bQString\\u8f6cchar*\"}]},{\"@type\":\"Article\",\"@id\":\"http:\/\/weizn.net\/?p=127#article\",\"isPartOf\":{\"@id\":\"http:\/\/weizn.net\/?p=127#webpage\"},\"author\":{\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\"},\"headline\":\"Qt\\u4e0bQString\\u8f6cchar*\",\"datePublished\":\"2015-05-18T12:02:21+00:00\",\"dateModified\":\"2015-05-18T12:02:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/weizn.net\/?p=127#webpage\"},\"wordCount\":93,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\"},\"articleSection\":[\"Qt\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/weizn.net\/?p=127#respond\"]}]},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\",\"name\":\"zinan\",\"logo\":{\"@id\":\"http:\/\/weizn.net\/#personlogo\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Qt\u4e0bQString\u8f6cchar* - Wayne&#039;s Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/weizn.net\/?p=127","og_locale":"zh_CN","og_type":"article","og_title":"Qt\u4e0bQString\u8f6cchar* - Wayne&#039;s Blog","og_description":"Qt\u4e0b\u9762\uff0c\u5b57\u7b26\u4e32\u90fd\u7528QString\uff0c\u786e\u5b9e\u7ed9\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u65b9\u4fbf\uff0c\u60f3\u60f3VC\u91cc\u9762\u5b9a\u4e49\u7684\u5404\u79cd\u53d8\u91cf\u7c7b\u578b\uff0c\u800c\u4e14\u51fd\u6570\u53c2\u6570\u7c7b\u578b\u4e94\u82b1\u516b\u95e8\uff0c\u7ecf\u5e38\u9700\u8981\u4eca\u5e74\u65b0\u90a3\u4e2a\u7c7b\u578b\u8f6c\u6362     Qt\u518d\u4f7f\u7528\u7b2c\u4e09\u65b9\u5f00\u6e90\u5e93\u65f6\uff0c\u7531\u4e8e\u5e93\u7684\u7c7b\u578b\u57fa\u672c\u4e0a\u90fd\u662f\u6807\u51c6\u7684\u7c7b\u578b\uff0c\u5b57\u7b26\u4e32\u9047\u7684\u591a\u7684\u5c31\u662fChar*\u7c7b\u578b     \u5728Qt\u4e0b\u600e\u6837\u5c06QString\u8f6cchar*\u5462\uff0c\u9700\u8981\u7528\u5230QByteArray\u7c7b\uff0cQByteArray\u7c7b\u7684\u8bf4\u660e\u8be6\u89c1Qt\u5e2e\u52a9\u6587\u6863\u3002     ...","og_url":"http:\/\/weizn.net\/?p=127","og_site_name":"Wayne&#039;s Blog","article_published_time":"2015-05-18T12:02:21+00:00","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"zinan","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"http:\/\/weizn.net\/#website","url":"http:\/\/weizn.net\/","name":"Wayne&#039;s Blog","description":"","publisher":{"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/weizn.net\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"WebPage","@id":"http:\/\/weizn.net\/?p=127#webpage","url":"http:\/\/weizn.net\/?p=127","name":"Qt\u4e0bQString\u8f6cchar* - Wayne&#039;s Blog","isPartOf":{"@id":"http:\/\/weizn.net\/#website"},"datePublished":"2015-05-18T12:02:21+00:00","dateModified":"2015-05-18T12:02:21+00:00","breadcrumb":{"@id":"http:\/\/weizn.net\/?p=127#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["http:\/\/weizn.net\/?p=127"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/weizn.net\/?p=127#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"http:\/\/weizn.net\/"},{"@type":"ListItem","position":2,"name":"Qt\u4e0bQString\u8f6cchar*"}]},{"@type":"Article","@id":"http:\/\/weizn.net\/?p=127#article","isPartOf":{"@id":"http:\/\/weizn.net\/?p=127#webpage"},"author":{"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264"},"headline":"Qt\u4e0bQString\u8f6cchar*","datePublished":"2015-05-18T12:02:21+00:00","dateModified":"2015-05-18T12:02:21+00:00","mainEntityOfPage":{"@id":"http:\/\/weizn.net\/?p=127#webpage"},"wordCount":93,"commentCount":0,"publisher":{"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264"},"articleSection":["Qt"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/weizn.net\/?p=127#respond"]}]},{"@type":["Person","Organization"],"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264","name":"zinan","logo":{"@id":"http:\/\/weizn.net\/#personlogo"}}]}},"_links":{"self":[{"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/posts\/127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=127"}],"version-history":[{"count":0,"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/posts\/127\/revisions"}],"wp:attachment":[{"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=127"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}