Quote Originally Posted by saqibmaqbool View Post
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.