SynEdit.FoldState
It only works for highlighter based folds.
If you select text, and fold/hide the selection, thin this is not included, and will not be restored.
The returned value only contain printable chars, and can be used in an xml.
It calls:
TSynEditFoldedView.GetFoldDescription(
If you call that directly, you can get binary representation too (none printable chars...). That is used when copy and paste folded text.