{"id":2402,"date":"2023-11-17T05:58:00","date_gmt":"2023-11-17T05:58:00","guid":{"rendered":"https:\/\/i.refvalue.org\/?p=2402"},"modified":"2025-12-01T09:32:11","modified_gmt":"2025-12-01T01:32:11","slug":"simple-encoding-conversion-via-__bstr_t","status":"publish","type":"post","link":"https:\/\/i.refvalue.org\/index.php\/2023\/11\/17\/simple-encoding-conversion-via-__bstr_t\/","title":{"rendered":"Windows String Representations and Simple Conversions via __bstr_t"},"content":{"rendered":"\n<p>The Windows NT kernel (from WinNT to Windows 11) internally uses UTF-16 strings by default, including <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows-hardware\/drivers\/kernel\/introduction-to-wdm\">Windows Drivers<\/a>, <a href=\"https:\/\/learn.microsoft.com\/en-us\/sysinternals\/resources\/inside-native-applications\">Native Applications<\/a> and COM clients and servers, etc. All other common encodings like UTF-8, GBK,  GB18030, BIG-5 should always be converted to UTF-16 before invocations to the kernel functions within <code>ntdll.dll<\/code>.<\/p>\n\n\n\n<p>There is a compatible layer upon the kernel layer, which is called Win32 API, a huge heritage left by the Win9X series. Win32 API is a family of functions for programmers to communicate with the operating system and hardware conveniently. Microsoft keeps this compatibility on the Windows NT Kernel so that most of the Win32 functions are still remaining unchanged and ABI-compatible. For example the <code>CreateFile<\/code> function does exist from Windows 98 to Windows 11. That is unbelievable because a Linux distribution may break any API in a minor update!<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>HANDLE CreateFile(\n  &#91;in&#93;           LPCSTR                lpFileName,\n  &#91;in&#93;           DWORD                 dwDesiredAccess,\n  &#91;in&#93;           DWORD                 dwShareMode,\n  &#91;in, optional&#93; LPSECURITY_ATTRIBUTES lpSecurityAttributes,\n  &#91;in&#93;           DWORD                 dwCreationDisposition,\n  &#91;in&#93;           DWORD                 dwFlagsAndAttributes,\n  &#91;in, optional&#93; HANDLE                hTemplateFile\n);<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D4D4D4\">HANDLE <\/span><span style=\"color: #DCDCAA\">CreateFile<\/span><span style=\"color: #D4D4D4\">(<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;in&#93;           LPCSTR                <\/span><span style=\"color: #9CDCFE\">lpFileName<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;in&#93;           DWORD                 <\/span><span style=\"color: #9CDCFE\">dwDesiredAccess<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;in&#93;           DWORD                 <\/span><span style=\"color: #9CDCFE\">dwShareMode<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;in, optional&#93; LPSECURITY_ATTRIBUTES <\/span><span style=\"color: #9CDCFE\">lpSecurityAttributes<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;in&#93;           DWORD                 <\/span><span style=\"color: #9CDCFE\">dwCreationDisposition<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;in&#93;           DWORD                 <\/span><span style=\"color: #9CDCFE\">dwFlagsAndAttributes<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;in, optional&#93; HANDLE                hTemplateFile<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">);<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>Some challenges started to occur. <a href=\"https:\/\/www.unicode.org\/versions\/Unicode16.0.0\/\">The Unicode Standard<\/a> was then generally accepted by OS vendors after Win9X was released while the Win9X was still using the <a href=\"https:\/\/www.ansi.org\/\">ANSI<\/a> encoding or some multi-byte encoding in the terminal country like GB2312 and BIG-5. The Windows NT Kernel chose the UTF-16 as its kernel string representations that hindered the working progress of compatibility. <\/p>\n\n\n\n<p>To resolve this issue, Microsoft&#8217;s talented engineers decided to create duplicates of the corresponding old Win32 APIs. The only difference of these two versions is the string types: <code>LPCSTR<\/code> vs <code>LPCWSTR<\/code>, the aliases of <code>const char*<\/code> and <code>const wchar_t*<\/code> in C++. The former represents the ANSI, and the latter stores a UTF-16 encoded string. To distinguish the mangled names at the C ABI level, the developers simply added a single-word suffix for the function: <code>-A<\/code> for the ANSI version and <code>-W<\/code> for the Unicode version. It provides much flexibility for users to call any of them in their projects.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>BOOL DeleteFileA(\n  &#91;in&#93; LPCSTR lpFileName\n);\n\nBOOL DeleteFileW(\n  &#91;in&#93; LPCWSTR lpFileName\n);<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D4D4D4\">BOOL <\/span><span style=\"color: #DCDCAA\">DeleteFileA<\/span><span style=\"color: #D4D4D4\">(<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;in&#93; LPCSTR lpFileName<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">BOOL <\/span><span style=\"color: #DCDCAA\">DeleteFileW<\/span><span style=\"color: #D4D4D4\">(<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;in&#93; LPCWSTR lpFileName<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">);<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>Generally speaking, the encoding API <code>MultibyteToWideChar<\/code> and <code>WideCharToMultiByte<\/code> are the usual way to reach the goal of interoperability for user-mode programs using different internal string representations on Windows.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>int WideCharToMultiByte(\n  &#91;in&#93;            UINT                               CodePage,\n  &#91;in&#93;            DWORD                              dwFlags,\n  &#91;in&#93;            _In_NLS_string_(cchWideChar)LPCWCH lpWideCharStr,\n  &#91;in&#93;            int                                cchWideChar,\n  &#91;out, optional&#93; LPSTR                              lpMultiByteStr,\n  &#91;in&#93;            int                                cbMultiByte,\n  &#91;in, optional&#93;  LPCCH                              lpDefaultChar,\n  &#91;out, optional&#93; LPBOOL                             lpUsedDefaultChar\n);\n\nint MultiByteToWideChar(\n  &#91;in&#93;            UINT                              CodePage,\n  &#91;in&#93;            DWORD                             dwFlags,\n  &#91;in&#93;            _In_NLS_string_(cbMultiByte)LPCCH lpMultiByteStr,\n  &#91;in&#93;            int                               cbMultiByte,\n  &#91;out, optional&#93; LPWSTR                            lpWideCharStr,\n  &#91;in&#93;            int                               cchWideChar\n);<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #569CD6\">int<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">WideCharToMultiByte<\/span><span style=\"color: #D4D4D4\">(<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;in&#93;            UINT                               <\/span><span style=\"color: #9CDCFE\">CodePage<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;in&#93;            DWORD                              <\/span><span style=\"color: #9CDCFE\">dwFlags<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;in&#93;            <\/span><span style=\"color: #DCDCAA\">_In_NLS_string_<\/span><span style=\"color: #D4D4D4\">(cchWideChar)LPCWCH <\/span><span style=\"color: #9CDCFE\">lpWideCharStr<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;in&#93;            <\/span><span style=\"color: #569CD6\">int<\/span><span style=\"color: #D4D4D4\">                                <\/span><span style=\"color: #9CDCFE\">cchWideChar<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;out, optional&#93; LPSTR                              <\/span><span style=\"color: #9CDCFE\">lpMultiByteStr<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;in&#93;            <\/span><span style=\"color: #569CD6\">int<\/span><span style=\"color: #D4D4D4\">                                <\/span><span style=\"color: #9CDCFE\">cbMultiByte<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;in, optional&#93;  LPCCH                              <\/span><span style=\"color: #9CDCFE\">lpDefaultChar<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;out, optional&#93; LPBOOL                             lpUsedDefaultChar<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">int<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">MultiByteToWideChar<\/span><span style=\"color: #D4D4D4\">(<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;in&#93;            UINT                              <\/span><span style=\"color: #9CDCFE\">CodePage<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;in&#93;            DWORD                             <\/span><span style=\"color: #9CDCFE\">dwFlags<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;in&#93;            <\/span><span style=\"color: #DCDCAA\">_In_NLS_string_<\/span><span style=\"color: #D4D4D4\">(cbMultiByte)LPCCH <\/span><span style=\"color: #9CDCFE\">lpMultiByteStr<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;in&#93;            <\/span><span style=\"color: #569CD6\">int<\/span><span style=\"color: #D4D4D4\">                               <\/span><span style=\"color: #9CDCFE\">cbMultiByte<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;out, optional&#93; LPWSTR                            <\/span><span style=\"color: #9CDCFE\">lpWideCharStr<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;in&#93;            <\/span><span style=\"color: #569CD6\">int<\/span><span style=\"color: #D4D4D4\">                               cchWideChar<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">);<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>It requires two calls to each function for one single conversion, the first call to calculate the buffer size and the second to perform the actual conversion. There is a simpler method to behave equivalently, that is to say, via the <code>__bstr_t<\/code> class that is supplied within <a href=\"https:\/\/learn.microsoft.com\/en-us\/cpp\/cpp\/compiler-com-support?view=msvc-170\">the compiler&#8217;s COM support<\/a>.<\/p>\n\n\n\n<p>The COM always uses UTF-16 strings as mentioned above and the <code>BSTR<\/code> type (that is <code>wchar_t*<\/code> with some extra header) is the standard string type of COM. MSVC has native support for <code>BSTR<\/code> called <code>__bstr_t<\/code>, an encapsulation of the <code>BSTR<\/code> data type, providing a simplified version compared with the general approach.<\/p>\n\n\n\n<p>A faster way to do encoding conversions is to instantiate an object of <code>_bstr_t<\/code> using the constructor based on the signature <code>const char*<\/code>. This overload takes an ANSI string and converts it to a UTF-16 string immediately and the <code>_bstr_t<\/code> has a <code>const wchar_t* operator()<\/code> to do the implicit cast and vice versa.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>#include &lt;string>\n#include &lt;string_view>\n\n#include &lt;comutil.h>\n\nconst std::string str{ \"Hello some \u6c49\u5b57 characters\" };\nconst _bstr_t wide_str{ str.c_str() };\nconst std::wstring_view{ wide_str };<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #C586C0\">#include<\/span><span style=\"color: #569CD6\"> <\/span><span style=\"color: #CE9178\">&lt;string&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #C586C0\">#include<\/span><span style=\"color: #569CD6\"> <\/span><span style=\"color: #CE9178\">&lt;string_view&gt;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #C586C0\">#include<\/span><span style=\"color: #569CD6\"> <\/span><span style=\"color: #CE9178\">&lt;comutil.h&gt;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">const<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4EC9B0\">std<\/span><span style=\"color: #D4D4D4\">::string str{ <\/span><span style=\"color: #CE9178\">&quot;Hello some \u6c49\u5b57 characters&quot;<\/span><span style=\"color: #D4D4D4\"> };<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">const<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4EC9B0\">_bstr_t<\/span><span style=\"color: #D4D4D4\"> wide_str{ <\/span><span style=\"color: #9CDCFE\">str<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">c_str<\/span><span style=\"color: #D4D4D4\">() };<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">const<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4EC9B0\">std<\/span><span style=\"color: #D4D4D4\">::wstring_view{ wide_str };<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>#include &lt;string>\n#include &lt;string_view>\n\n#include &lt;comutil.h>\n\nconst std::wstring str{ L\"\u4e00\u4e9b\u5bbd\u5b57\u7b26\uff0c\u9006\u5411\u8f6c\u6362\" };\nconst _bstr_t wide_str{ str.c_str() };\nconst std::string_view{ wide_str };<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #C586C0\">#include<\/span><span style=\"color: #569CD6\"> <\/span><span style=\"color: #CE9178\">&lt;string&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #C586C0\">#include<\/span><span style=\"color: #569CD6\"> <\/span><span style=\"color: #CE9178\">&lt;string_view&gt;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #C586C0\">#include<\/span><span style=\"color: #569CD6\"> <\/span><span style=\"color: #CE9178\">&lt;comutil.h&gt;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">const<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4EC9B0\">std<\/span><span style=\"color: #D4D4D4\">::wstring str{ <\/span><span style=\"color: #CE9178\">L&quot;\u4e00\u4e9b\u5bbd\u5b57\u7b26\uff0c\u9006\u5411\u8f6c\u6362&quot;<\/span><span style=\"color: #D4D4D4\"> };<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">const<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4EC9B0\">_bstr_t<\/span><span style=\"color: #D4D4D4\"> wide_str{ <\/span><span style=\"color: #9CDCFE\">str<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">c_str<\/span><span style=\"color: #D4D4D4\">() };<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">const<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4EC9B0\">std<\/span><span style=\"color: #D4D4D4\">::string_view{ wide_str };<\/span><\/span><\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>The Windows NT kernel (from WinNT to Windows 11) internally uses UTF-16 strings by default, including Windows Drivers, Native Applications and COM clients and servers, etc. All other common encodings like UTF-8, GBK, GB18030, BIG-5 should always be converted to UTF-16 before invocations to the kernel functions within ntdll.dll. There is a compatible layer upon &hellip; <a href=\"https:\/\/i.refvalue.org\/index.php\/2023\/11\/17\/simple-encoding-conversion-via-__bstr_t\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Windows String Representations and Simple Conversions via __bstr_t&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,9],"tags":[5,11,8],"class_list":["post-2402","post","type-post","status-publish","format-standard","hentry","category-c","category-win32","tag-c","tag-encoding","tag-win32"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Windows String Representations and Simple Conversions via __bstr_t - Refvalue&#039;s Whispering Woods<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/i.refvalue.org\/index.php\/2023\/11\/17\/simple-encoding-conversion-via-__bstr_t\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Windows String Representations and Simple Conversions via __bstr_t - Refvalue&#039;s Whispering Woods\" \/>\n<meta property=\"og:description\" content=\"The Windows NT kernel (from WinNT to Windows 11) internally uses UTF-16 strings by default, including Windows Drivers, Native Applications and COM clients and servers, etc. All other common encodings like UTF-8, GBK, GB18030, BIG-5 should always be converted to UTF-16 before invocations to the kernel functions within ntdll.dll. There is a compatible layer upon &hellip; Continue reading &quot;Windows String Representations and Simple Conversions via __bstr_t&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/i.refvalue.org\/index.php\/2023\/11\/17\/simple-encoding-conversion-via-__bstr_t\/\" \/>\n<meta property=\"og:site_name\" content=\"Refvalue&#039;s Whispering Woods\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-17T05:58:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-01T01:32:11+00:00\" \/>\n<meta name=\"author\" content=\"refvalue\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"refvalue\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/i.refvalue.org\\\/index.php\\\/2023\\\/11\\\/17\\\/simple-encoding-conversion-via-__bstr_t\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/i.refvalue.org\\\/index.php\\\/2023\\\/11\\\/17\\\/simple-encoding-conversion-via-__bstr_t\\\/\"},\"author\":{\"name\":\"refvalue\",\"@id\":\"https:\\\/\\\/i.refvalue.org\\\/#\\\/schema\\\/person\\\/968c7dfefa7e2b45a131a884adbbf387\"},\"headline\":\"Windows String Representations and Simple Conversions via __bstr_t\",\"datePublished\":\"2023-11-17T05:58:00+00:00\",\"dateModified\":\"2025-12-01T01:32:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/i.refvalue.org\\\/index.php\\\/2023\\\/11\\\/17\\\/simple-encoding-conversion-via-__bstr_t\\\/\"},\"wordCount\":466,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/i.refvalue.org\\\/#\\\/schema\\\/person\\\/968c7dfefa7e2b45a131a884adbbf387\"},\"keywords\":[\"C++\",\"Encoding\",\"Win32\"],\"articleSection\":[\"C++\",\"Win32\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/i.refvalue.org\\\/index.php\\\/2023\\\/11\\\/17\\\/simple-encoding-conversion-via-__bstr_t\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/i.refvalue.org\\\/index.php\\\/2023\\\/11\\\/17\\\/simple-encoding-conversion-via-__bstr_t\\\/\",\"url\":\"https:\\\/\\\/i.refvalue.org\\\/index.php\\\/2023\\\/11\\\/17\\\/simple-encoding-conversion-via-__bstr_t\\\/\",\"name\":\"Windows String Representations and Simple Conversions via __bstr_t - Refvalue&#039;s Whispering Woods\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/i.refvalue.org\\\/#website\"},\"datePublished\":\"2023-11-17T05:58:00+00:00\",\"dateModified\":\"2025-12-01T01:32:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/i.refvalue.org\\\/index.php\\\/2023\\\/11\\\/17\\\/simple-encoding-conversion-via-__bstr_t\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/i.refvalue.org\\\/index.php\\\/2023\\\/11\\\/17\\\/simple-encoding-conversion-via-__bstr_t\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/i.refvalue.org\\\/index.php\\\/2023\\\/11\\\/17\\\/simple-encoding-conversion-via-__bstr_t\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/i.refvalue.org\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Windows String Representations and Simple Conversions via __bstr_t\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/i.refvalue.org\\\/#website\",\"url\":\"https:\\\/\\\/i.refvalue.org\\\/\",\"name\":\"Refvalue's Whispering Woods\",\"description\":\"Email: cosmicbytecode@gmail.com\",\"publisher\":{\"@id\":\"https:\\\/\\\/i.refvalue.org\\\/#\\\/schema\\\/person\\\/968c7dfefa7e2b45a131a884adbbf387\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/i.refvalue.org\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/i.refvalue.org\\\/#\\\/schema\\\/person\\\/968c7dfefa7e2b45a131a884adbbf387\",\"name\":\"refvalue\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b380a5ef2d3d8de84eae26847c2dcd82df59b6f96ccc5c521a74795525566720?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b380a5ef2d3d8de84eae26847c2dcd82df59b6f96ccc5c521a74795525566720?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b380a5ef2d3d8de84eae26847c2dcd82df59b6f96ccc5c521a74795525566720?s=96&d=mm&r=g\",\"caption\":\"refvalue\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b380a5ef2d3d8de84eae26847c2dcd82df59b6f96ccc5c521a74795525566720?s=96&d=mm&r=g\"},\"sameAs\":[\"https:\\\/\\\/i.refvalue.org\"],\"url\":\"https:\\\/\\\/i.refvalue.org\\\/index.php\\\/author\\\/refvalue\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Windows String Representations and Simple Conversions via __bstr_t - Refvalue&#039;s Whispering Woods","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":"https:\/\/i.refvalue.org\/index.php\/2023\/11\/17\/simple-encoding-conversion-via-__bstr_t\/","og_locale":"en_US","og_type":"article","og_title":"Windows String Representations and Simple Conversions via __bstr_t - Refvalue&#039;s Whispering Woods","og_description":"The Windows NT kernel (from WinNT to Windows 11) internally uses UTF-16 strings by default, including Windows Drivers, Native Applications and COM clients and servers, etc. All other common encodings like UTF-8, GBK, GB18030, BIG-5 should always be converted to UTF-16 before invocations to the kernel functions within ntdll.dll. There is a compatible layer upon &hellip; Continue reading \"Windows String Representations and Simple Conversions via __bstr_t\"","og_url":"https:\/\/i.refvalue.org\/index.php\/2023\/11\/17\/simple-encoding-conversion-via-__bstr_t\/","og_site_name":"Refvalue&#039;s Whispering Woods","article_published_time":"2023-11-17T05:58:00+00:00","article_modified_time":"2025-12-01T01:32:11+00:00","author":"refvalue","twitter_card":"summary_large_image","twitter_misc":{"Written by":"refvalue","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/i.refvalue.org\/index.php\/2023\/11\/17\/simple-encoding-conversion-via-__bstr_t\/#article","isPartOf":{"@id":"https:\/\/i.refvalue.org\/index.php\/2023\/11\/17\/simple-encoding-conversion-via-__bstr_t\/"},"author":{"name":"refvalue","@id":"https:\/\/i.refvalue.org\/#\/schema\/person\/968c7dfefa7e2b45a131a884adbbf387"},"headline":"Windows String Representations and Simple Conversions via __bstr_t","datePublished":"2023-11-17T05:58:00+00:00","dateModified":"2025-12-01T01:32:11+00:00","mainEntityOfPage":{"@id":"https:\/\/i.refvalue.org\/index.php\/2023\/11\/17\/simple-encoding-conversion-via-__bstr_t\/"},"wordCount":466,"commentCount":0,"publisher":{"@id":"https:\/\/i.refvalue.org\/#\/schema\/person\/968c7dfefa7e2b45a131a884adbbf387"},"keywords":["C++","Encoding","Win32"],"articleSection":["C++","Win32"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/i.refvalue.org\/index.php\/2023\/11\/17\/simple-encoding-conversion-via-__bstr_t\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/i.refvalue.org\/index.php\/2023\/11\/17\/simple-encoding-conversion-via-__bstr_t\/","url":"https:\/\/i.refvalue.org\/index.php\/2023\/11\/17\/simple-encoding-conversion-via-__bstr_t\/","name":"Windows String Representations and Simple Conversions via __bstr_t - Refvalue&#039;s Whispering Woods","isPartOf":{"@id":"https:\/\/i.refvalue.org\/#website"},"datePublished":"2023-11-17T05:58:00+00:00","dateModified":"2025-12-01T01:32:11+00:00","breadcrumb":{"@id":"https:\/\/i.refvalue.org\/index.php\/2023\/11\/17\/simple-encoding-conversion-via-__bstr_t\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/i.refvalue.org\/index.php\/2023\/11\/17\/simple-encoding-conversion-via-__bstr_t\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/i.refvalue.org\/index.php\/2023\/11\/17\/simple-encoding-conversion-via-__bstr_t\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/i.refvalue.org\/"},{"@type":"ListItem","position":2,"name":"Windows String Representations and Simple Conversions via __bstr_t"}]},{"@type":"WebSite","@id":"https:\/\/i.refvalue.org\/#website","url":"https:\/\/i.refvalue.org\/","name":"Refvalue's Whispering Woods","description":"Email: cosmicbytecode@gmail.com","publisher":{"@id":"https:\/\/i.refvalue.org\/#\/schema\/person\/968c7dfefa7e2b45a131a884adbbf387"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/i.refvalue.org\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/i.refvalue.org\/#\/schema\/person\/968c7dfefa7e2b45a131a884adbbf387","name":"refvalue","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b380a5ef2d3d8de84eae26847c2dcd82df59b6f96ccc5c521a74795525566720?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b380a5ef2d3d8de84eae26847c2dcd82df59b6f96ccc5c521a74795525566720?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b380a5ef2d3d8de84eae26847c2dcd82df59b6f96ccc5c521a74795525566720?s=96&d=mm&r=g","caption":"refvalue"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/b380a5ef2d3d8de84eae26847c2dcd82df59b6f96ccc5c521a74795525566720?s=96&d=mm&r=g"},"sameAs":["https:\/\/i.refvalue.org"],"url":"https:\/\/i.refvalue.org\/index.php\/author\/refvalue\/"}]}},"_links":{"self":[{"href":"https:\/\/i.refvalue.org\/index.php\/wp-json\/wp\/v2\/posts\/2402","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/i.refvalue.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/i.refvalue.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/i.refvalue.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/i.refvalue.org\/index.php\/wp-json\/wp\/v2\/comments?post=2402"}],"version-history":[{"count":23,"href":"https:\/\/i.refvalue.org\/index.php\/wp-json\/wp\/v2\/posts\/2402\/revisions"}],"predecessor-version":[{"id":2642,"href":"https:\/\/i.refvalue.org\/index.php\/wp-json\/wp\/v2\/posts\/2402\/revisions\/2642"}],"wp:attachment":[{"href":"https:\/\/i.refvalue.org\/index.php\/wp-json\/wp\/v2\/media?parent=2402"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/i.refvalue.org\/index.php\/wp-json\/wp\/v2\/categories?post=2402"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/i.refvalue.org\/index.php\/wp-json\/wp\/v2\/tags?post=2402"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}