title: Unicode supported isdigit and isspace function
body: <p>I have the following code.</p>
  
  <pre><code>// mfc.cpp : Defines the entry point for the console application.
  //
  
  #include "stdafx.h"
  #include "mfc.h"
  
  #ifdef _DEBUG
  #define new DEBUG_NEW
  #endif
  
  #include &lt;cctype&gt;
  #include &lt;string&gt;
  #include &lt;sstream&gt;
  #include &lt;tchar.h&gt;
  #include &lt;iostream&gt;
  #include &lt;Strsafe.h&gt;
  #include &lt;algorithm&gt;
  #include &lt;cmath&gt;
  #include &lt;limits&gt;
  #include &lt;functional&gt;
  #include &lt;cassert&gt;
  
  std::wstring toStringWithoutNumerical(const std::wstring&amp; str) {
      std::wstring result;
  
      bool alreadyAppendSpace = false;
      for (int i = 0, length = str.length(); i &lt; length; i++) {
          const TCHAR c = str.at(i);
          if (isdigit(c)) {
              continue;
          }
          if (isspace(c)) {
              if (false == alreadyAppendSpace) {
                  result.append(1, c);
                  alreadyAppendSpace = true;
              }
              continue;
          }
          result.append(1, c);
          alreadyAppendSpace = false;
      }
  
      return result;
  }
  
  
  // The one and only application object
  
  CWinApp theApp;
  
  using namespace std;
  
  int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
  {
      int nRetCode = 0;
  
      // initialize MFC and print and error on failure
      if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
      {
          // TODO: change error code to suit your needs
          _tprintf(_T("Fatal Error: MFC initialization failed\n"));
          nRetCode = 1;
      }
      else
      {
          // TODO: code your application's behavior here.
      }
  
      std::wstring me = toStringWithoutNumerical(_T("My Leg 1 Long"));
      AfxMessageBox(me.c_str());
  
      // Crash!
      std::wstring he = toStringWithoutNumerical(L"我的脚1盘");
      AfxMessageBox(he.c_str());
  
      return nRetCode;
  }
  </code></pre>
  
  <p>For 1st message box,</p>
  
  <p><strong>My Leg Long</strong></p>
  
  <p>will be shown.</p>
  
  <p>For 2nd message box, crash will happen, with assertion fail at isctype.c</p>
  
  <pre><code>_ASSERTE((unsigned)(c + 1) &lt;= 256);
  </code></pre>
  
  <p>How I can get a standard function (isdigit, isspace...), to support unicode out of 256 range?</p>