title: Is there any built-in function that convert wstring or wchar_t* to UTF-8 in Linux?
body: <p>I want to convert wstring to UTF-8 Encoding, but I want to use built-in functions of Linux.</p>
  
  <p>Is there any built-in function that convert <code>wstring</code> or <code>wchar_t*</code> to UTF-8 in Linux <strong>with simple invokation</strong>?</p>
  
  <p>Example:</p>
  
  <pre><code>wstring str = L"file_name.txt";
  wstring mode = "a";
  fopen([FUNCTION](str), [FUNCTION](mode)); // Simple invoke.
  cout &lt;&lt; [FUNCTION](str); // Simple invoke.
  </code></pre>