Re: Problem with folding CSS files
"'Neil Hodgson' via scintilla-interest" <[email protected]>
| Newsgroups | gmane.comp.lib.scintilla.devel |
|---|---|
| Message-ID | <[email protected]> |
Andrew Truckle:
> It seems that I am using ILoader and reading the whole file, including BOM and this is being put in Scntilla. Have to find out how to address that because SciTE behaves correctly as one would expect.
You probably don't want all of SciTE's associated code (in the Utf8_16 module) as that is complicated by potentially converting from UTF-16 to UTF-8. You may not need to handle UTF-16 files (at least initially) as they are rare.
Just check for the presence of a UTF-8 BOM on the first block read with something similar to if (block.starts_with("\xef\xbb\xbf")) then omit that if its present with pLoader->AddData(block.data() + 3, block.size()-3). There are multiple occurrences of this pattern in SciTE - search for "UTF8BOM".
Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/scintilla-interest/E811911E-2F68-42F0-BB56-2B1D1A237E92%40me.com.