Maximun number characters in String


#1

Hi!

I’m trying to parse a 88 MB XML file.
Always returns NULL with:

xml = XmlDocument::parse (file);

Tracing into JUCE:

In: XmlElement* XmlDocument::getDocumentElement (const bool onlyReadOuterDocumentElement)

(...)
        if (input.getAddress() != nullptr)
        {
            ScopedPointer <XmlElement> result (readNextElement (! onlyReadOuterDocumentElement));

            if (! errorOccurred)
                return result.release();
        }
        else
        {
            lastError = "incorrect xml header";
        }
(...)

errorOccurred = “unmatched tags”

I think the problem is String can’t hold the 88MB…
What’s the maximun number characters in String (UTF-8)?

Thank in advance.


#2

[quote]I think the problem is String can’t hold the 88MB…
What’s the maximun number characters in String (UTF-8)?[/quote]

Nope. The limit is 2^32 chars.

Most likely your XML file has an error in it.


#3

Uhm… so… maybe a problem with enconding…


#4

Yes! Was a ANSI - UTF-8 problem!!!

Thanks and sorry!