0

I have a program, that takes an .rtf file, reads it, and then creates a new .rtf file to write there some lines from the first document.

The problem is that it loses non-ascii characters.

The program gets a line from .rtf with fgetws(strBuff, ...), and the line it gets is correct.

But then it does an assignment strIn = strBuf, and in strIn we see "u" instead of "ü", "a" instead of "ä", "o" instead of "ö" and "?" instead of "ß" (these are German extensions to the 7-bit ascii standard).

Now can we make C++ not to lose all of this while assignment?

peterh
  • 11,875
  • 18
  • 85
  • 108
Fruling
  • 90
  • 1
  • 6
  • 3
    Please also upload the crystal ball that knows that `strIn` is. – Kerrek SB Sep 29 '16 at 09:19
  • 1
    Please provide a [minimal complete and verifiable example](http://stackoverflow.com/help/mcve), you aren't giving enough information to allow helping you without guessing. – AProgrammer Sep 29 '16 at 09:20
  • I internationalized your question a little bit, we know what are "umlaut" and "eszett" but most of the readers don't. – peterh Oct 02 '16 at 16:12

1 Answers1

0

Oh, I've found it. strIn was a CStringA while strBuff was CString. I'm working with C++ the second day so it was a bit tough to solve this simple example. Sorry for not providing enough information, I was working without types too much =__=

Fruling
  • 90
  • 1
  • 6