|
-
September 26th, 2012, 04:30 AM
#9
Re: how to read a wide charcter one by one from a *.txt file in c++
 Originally Posted by saqibmaqbool
it is strange that when i do not write new line character or "endl" after outputfile<<arry[i]; then the input and output files are almost same
but when i write as outputfile<<arry[i]<<endl; to get each urdu character separately then it gives some ugly looking symbols in file. i have also corrected the while condition but problem is still present there
The array is just a sequence of values; these are not unicode characters. When a single unicode character is represented by more that one subsequent wchar_t and you split it up in individual values, then of course you get rubbish. It seems that your problem is that you don't understand how unicode works; it's not about files or streams.
Cheers, D Drmmr
Please put [code][/code] tags around your code to preserve indentation and make it more readable.
As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|