Closed shamun closed 5 years ago
On the command prompt when i display accent character, its not broken.
But when i am reading and outputting it in command prompt the accent characters are shown as ..
.
Let me know, what might be the mistake of my code?
Thank you.
These values are stored as UTF8 on the card.
This print function just prints byte per byte, so special chars that are stored over multiple bytes are not printed correct. I'll have a look at this, thanks for reporting
I think we should have this? Because otherwise accented output on the command prompt is absolutely broken.
#include <locale.h>
#include <stdio.h>
int main()
{
int c;
char* l = setlocale(LC_ALL, "");
if (l == NULL) {
printf("Locale not set\n");
} else {
printf("Locale set to %s\n", l);
}
printf("%ls\n", L"s:\\яшертыHello");
return 0;
}
Run: https://wandbox.org/permlink/HyF6E0SJ3AsUK4PL
Please let me know if you have any update. Then i will setup my environment. I lost my entire environment to debug and find the real issue.
Hello,
You could use SetConsoleOutputCP(CP_UTF8); to set the windows console to print utf8 And then print the utf8 string that comes from the eid card (keep in mind it is not null terminated).
Also updated our C example
Hello,
Firstname and Lastname characters such as
ë
is not properly outputing asë
, its becoming..
. What is my mistake?