views:

320

answers:

2

I'm trying to open old projects generated in Delphi 7 with Delphi 2009. On some projects, this causes the following error message from the IDE:

"An invalid character was found in text content"

The affected projects are working fine in the old IDE. How can I solve this?

A: 

Sounds like you have non-compatible 8-bit character in your .dpr file. Maybe it helps if you either clean the file or convert it to utf-8 with some text editor and try again.

Harriv
What are non-compatible 8-bit characters? Does Delphi 7 write those? Anyway, aren't there unicode code points for every bit combination in the first byte due to unicode's downward compatibility?When I open and convert the dpr as text files with Notepad++, Delphi 2009 agrees to open them. Although, doing the same using a small application written in 2009 with the TStringList.SaveToFile(string, TEncoding) method seems to fail. Doing this using some of the standard TEncoding's (e.g. TEncoding.UTF8, TEncoding.Unicode), the same error message still occurs.
kaeff
A: 

I could track down the problem. Although the project files had already been Unicode-encoded, there were some special characters in the .cfg file that caused the hiccups. They were the value of a special file attribute that wasn't visible in the IDE.

kaeff