fork download
  1. #include <locale.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. int main (void)
  6. {
  7. setlocale (LC_ALL, "en_US.UTF-8");
  8. wchar_t wca[] = L"€€€€€€€€€€";
  9. wchar_t wcb[] = L"€€€€€€€€€€";
  10. size_t q;
  11.  
  12. q = mbstowcs (wca, "äåâ", 3);
  13. printf ("mbstowcs: %i: \"%ls\"\n", q, wca);
  14.  
  15. q = mbstowcs (wcb, "äåâ", 6);
  16. printf ("mbstowcs: %i: \"%ls\"\n", q, wcb);
  17.  
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0.01s 3932KB
stdin
Standard input is empty
stdout
mbstowcs: 3: "äå €€€€€"
mbstowcs: 3: "äåâ"