Re: Write/Read of wchar in buffer/file

Tech-Archive recommends: Fix windows errors by optimizing your registry



Let me see if I understand... you want to write a Unicode string to a file
that may or may not contain non-Unicode characters and then read them back.
I've never done that, but it sounds problematic to me. If it were me I'd do
the whole thing in Unicode then use CFile to do the file handling. That
said, I think you can still use CFile, I just think your file will be
difficult to parse.

Tom

"Viraj" <Viraj@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:22F592A1-6BE6-4283-95E0-25C92BBCC0FF@xxxxxxxxxxxxxxxx
> Hello All,
>
> I have a buffer (lets say x) pointed to by WCHAR *. I have to write this
> buffer x to a file which also contains Non-Unicode chars. Finally I have
> to
> read the wchars x from the file and write them to a buffer pointed to by
> WCHAR *.
>
> Can anyone please let me know what calls I can use to store the buffer to
> the file and read from the file and copy it to the buffer ?
>
> Thanks,
> Viraj
> a.viraj@xxxxxxxxxxxx
> http://www.mobiliti.com
> 732-248-8300


.



Relevant Pages

  • Re: Write/Read of wchar in buffer/file
    ... assuming you have a WCHAR * that only contains the ... The inverse applies to reading 8-bit text from a file and converting it to Unicode. ... >buffer x to a file which also contains Non-Unicode chars. ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: Write/Read of wchar in buffer/file
    ... > I have a buffer pointed to by WCHAR *. ... > buffer x to a file which also contains Non-Unicode chars. ... E.g. the common ASCII char 'a' is the Unicode character U+0061, ... E.g. Chinese characters are Unicode, ...
    (microsoft.public.vc.language)
  • Re: Need help with UNICIDE_STRING?
    ... >Basically, what I wanted is a unicode string, which can receive a string ... PWSTR Buffer; ... There are many RTL macros to initialise, allocate and copy unicode strings. ... As to the size of the stack it is best not to allocate large structures on the ...
    (microsoft.public.win32.programmer.kernel)
  • Re: How to use function strcpy to copy unsigned char?
    ... Unicode string, in which case there are so many other things wrong in this ... code that they would have to be fixed first. ... but making the buffer unsigned char doesn't matter. ...
    (microsoft.public.vc.mfc)
  • Re: How to use function strcpy to copy unsigned char?
    ... I thought it was some kind of Unicode string. ... it never occurred to me that someone this naive would understand machine code ... but making the buffer unsigned char doesn't matter. ...
    (microsoft.public.vc.mfc)