title: Specifying a scanset along with the 'h' width modifier in "swscanf" doesn't work with MSVC
body: <p>I would like to store the result of reading in a wide string using <strong>swscanf</strong> into a narrow string, but I would like to read <strong>all</strong> input until a new-line character. I have the following simple example code to demonstrate what I mean:</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
      const wchar_t* source_string = L&quot;Hello world\n&quot;;
      char new_string[100];
  
      swscanf(source_string, L&quot;%h[^\n]&quot;, new_string);
      wprintf(L&quot;%hs&quot;, new_string);
      return 0;
  }
  </code></pre>
  <p>This works fine with gcc, but produces garbage output with MSVC, with a warning:</p>
  <pre><code>warning C4475: 'swscanf' : length modifier 'h' cannot be used with type field character ']' in format specifier
  </code></pre>
  <p>Note that <strong>wprintf</strong> above is just to test and see the output.</p>
  <p>Is there a way around this? Is this just MSVC not complying to the actual ANSI C printf/scanf standards?</p>