fork download
  1. #include <wchar.h>
  2. #include <stdio.h>
  3. #include <locale.h>
  4.  
  5. int main() {
  6. // Set locale to support wide characters (UTF-8)
  7. setlocale(LC_ALL, "");
  8.  
  9. wchar_t wstr[] = L"नमस्ते 🌏";
  10.  
  11. wprintf(L"Wide String: %ls\n", wstr);
  12. wprintf(L"Length (characters): %zu\n", wcslen(wstr));
  13.  
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
Wide String: नमस्ते 🌏
Length (characters): 8