chkn
July 3, 2010, 12:48pm
1
I noticed the new build of Jucer 1.11 doesn’t load my old jucer-cpp files any more.
Older builds are working.
String::createStringFromData uses String::fromUTF8 (data, size) for encoding, and it breaks at my non-UTF8 ANSI “Ü” Hex 0xFC
[code]while (–numExtraValues >= 0 && i < (size_t) bufferSizeBytes)
{
const char nextByte = buffer[i];
if ((nextByte & 0xc0) != 0x80)
break;
[/code]
Did you change here something recently?
Maybe its better not to break and truncate the file, better ignore the character or use the ISO8859 table as a fallback ?
CallStack
String::fromUTF8 (data, size)
String::createStringFromData
FileInputStream::readEntireStreamAsString();
String File::loadFileAsString()
JucerDocument* loadDocumentFromFile
jules
July 3, 2010, 3:26pm
2
Probably a better idea to actually save the cpp file in utf8, isn’t it…? I’d have thought these days that most editors would use utf8 by default?
chkn
July 3, 2010, 6:07pm
3
yes for me of course (i only edited the file with VC++ mmhhh… )
But String::fromUTF8 will be used in many circumstances, and a normal user doesn’t see the problem behind, he only see that his application does not work properly
chkn
January 21, 2011, 6:35pm
4
jules, this issue is still present in the old and the new Jucer, if there is a unknown char, the processing should not completely stopped, either it shoud ignore the char or it should jassert or give a error message back
jules
January 21, 2011, 6:42pm
5
Could you email me an offending file so I can have a go myself?
chkn
January 21, 2011, 7:09pm
6
try to add this file into a jucer 3 project, and open it in the jucer text-editor, you will only see the first line
When the code comment was Chinese, the problem will become even more serious, even undermine all code of post-edit or added.