I'd like to know how exactly to replace one letter by another in a file containing Unicode characters (wide characters (wchar_t)). I try with the following code, but it does not work, I get every time an endless loop:
Code:do { letter = fgetwc (file); //printf("%d\n", debug++); if( letter == 'a') { //puts("OK" ); fseek(file, - sizeof(wchar_t), SEEK_CUR); fputwc('b', file); } } while(letter != WEOF);
Bookmarks