1

In C, after setting a new locale withsetlocale(LC_ALL, "Hebrew"), I could print the new local name (Hebrew.Israel.1255), but couldn't figure how to use the new locale's charset, sinceprintf(%c, 240) printed '?' instead of a hebrew letter(1255 map).

.

Thanks in advance!

winuall
  • 359
  • 1
  • 5
  • 13

1 Answers1

1

The %c format specifier always prints a byte with the given value. It has nothing to do with the locale. You should use something like printf("%lc", 0x05D0); which will print a wide character (which is encoded in Unicode on all sane implementations) in the current locale's encoding.

R.. GitHub STOP HELPING ICE
  • 208,859
  • 35
  • 376
  • 711