fork download
  1. static unsigned long ToUtf8Ch(wchar_t ch)
  2. {
  3. unsigned long ret;
  4. if ( ch > 0x7F ) // ANSI
  5. {
  6. if ( ch > 0x7FF ) // MB
  7. {
  8. if ( ch > 0xffff ) // Long
  9. {
  10. // 이거 이상이 wchar_t에선 없음
  11. ret = (ch >> 18) | 0xF0;
  12. ret <<= 8;
  13. ret |= ((ch >> 12) & 0x3F) | 0x80;
  14. ret <<= 8;
  15. ret |= ((ch >> 6) & 0x3F) | 0x80;
  16. ret <<= 8;
  17. ret |= (ch & 0x3F) | 0x80;
  18. }
  19. else
  20. {
  21. ret = (ch >> 12) | 0xE0;
  22. ret <<= 8;
  23. ret |= ((ch >> 6) & 0x3F) | 0x80;
  24. ret <<= 8;
  25. ret |= (ch & 0x3F) | 0x80;
  26. }
  27. }
  28. else
  29. {
  30. // 2 Bytes Code
  31. ret = (ch >> 6) | 0xC0;
  32. ret <<= 8;
  33. ret |= (ch & 0x3F) | 0x80;
  34. }
  35. }
  36. else
  37. {
  38. // ASNI Code
  39. ret = ch;
  40. }
  41. return ret;
  42. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:1:33: error: unknown type name 'wchar_t'
   static unsigned long ToUtf8Ch(wchar_t ch)
                                 ^
stdout
Standard output is empty