Problem with strlen() and UTF8 characters
posted by softweb on 2009-06-18 00:00:00
#include <stdio.h> #include <string.h> #include <stdlib.h> int main(){ char *s; s = (char *) malloc(sizeof(char)*100); scanf("%s", s); printf("Len: %d\n", strlen(s)); return 0; }
What could i do to fix it?
Thank you

12
You have to use wcslen() function.It returns wide-character string length.
Bye.
#include <wchar.h> size_t wcslen(const wchar_t *ws);
Bye.

2
Thank you
Bye
Bye
Answer the question
Top Users
- dail (12)
- livin52 (3)
- camu (3)
- softweb (2)
- Nadine (1)
- Josware (1)
- lfelipecr (1)
- gregoriohc (1)
- Mitu (1)
- ryan714 (1)