Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 833
  • Last Modified:

Save and load unicode text files

How do I save and load unicode text files in MFC using doc/view?
0
stl
Asked:
stl
1 Solution
 
chensuCommented:
If your application is built for Unicode version only (the UNICODE macro is defined), you can simply use CArchive::WriteString and CArchive::ReadString with Unicode strings. If your application is built for both Unicode and ANSI version, you need to use CArchive::Write and CArchive::Read.

WCHAR lpwsz[] = L"abc";
ar.Write(lpwsz, lstrlenW(lpwsz) * sizeof(WCHAR));
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now