Re: Problem with folding CSS files
Andrew Truckle <[email protected]>
| Newsgroups | gmane.comp.lib.scintilla.devel |
|---|---|
| Message-ID | <[email protected]> |
Thank you, I have adapted my code to detect the UTF8 BOM and skip it when
reading.
On Saturday 4 May 2024 at 23:57:46 UTC+1 Neil Hodgson wrote:
> 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/b7b7c89d-cde0-44fd-bc28-92873b0cead2n%40googlegroups.com.