reading unicode files
-
Hi all, I am making my application unicode supporting one. i have .txt,.doc files.. i want to upload the file in my application. I want to check what type of file before loading.. i am able to check whether ANSII or Unicode using BOM. I dont know how to check for UTf-8 and Unicode Big Endian type files. Its not accepting BOM condition. Does anyone know how to check that one? ------------------------------------------------ Code Snippet: This is how, i check for unicode encoded file: if (file.Read(&firstChar, sizeof(wchar_t)) > 0 && firstChar == (wchar_t)0xFEFF) { ...... } But, UTF-8 and unicode big endian type of files dont satisfy this condition. -------------------- Please guide me how to resolve this issue. Thanks, Rakesh.
-
Hi all, I am making my application unicode supporting one. i have .txt,.doc files.. i want to upload the file in my application. I want to check what type of file before loading.. i am able to check whether ANSII or Unicode using BOM. I dont know how to check for UTf-8 and Unicode Big Endian type files. Its not accepting BOM condition. Does anyone know how to check that one? ------------------------------------------------ Code Snippet: This is how, i check for unicode encoded file: if (file.Read(&firstChar, sizeof(wchar_t)) > 0 && firstChar == (wchar_t)0xFEFF) { ...... } But, UTF-8 and unicode big endian type of files dont satisfy this condition. -------------------- Please guide me how to resolve this issue. Thanks, Rakesh.
00 00 FE FF UTF-32, big-endian FF FE 00 00 UTF-32, little-endian FE FF UTF-16, big-endian FF FE UTF-16, little-endian EF BB BF UTF-8
«_Superman_» I love work. It gives me something to do between weekends.
-
00 00 FE FF UTF-32, big-endian FF FE 00 00 UTF-32, little-endian FE FF UTF-16, big-endian FF FE UTF-16, little-endian EF BB BF UTF-8
«_Superman_» I love work. It gives me something to do between weekends.
Hi Superman, I tried exactly those methods you have mentioned in my code.. But to my surprise, it didnt work well.. Can you please guide me how to resolve this issue??
Mohan