A real strange thing ...

Using Carbon I store a styled text file in a textarea with the save method.

All the text properties (like text color, size, etc.) are saved with the file.

But if I view this file with a hex editor I can’t find any formatting bytes - so where is it saved? Under Cocoa this is done with backslash chars followed by codes - but as I said - under Carbon it seems to be mystic.

Does anybody know where the format information is stored?

Resource fork?

Hex Edit says that this file has no RSRC fork …

Resource Forks are obsolete if I recall.

HOW are you saving the Data?

I load/save Styled Text via the RTFData property (there are a few other topics here that discuss this as well)

As I said - I save it with the save method of the textarea control.

This item has been DEPRECATED since version 2013r1 and should no longer be used.
Please use TextArea.StyledText.RTFData as a replacement.

I would suggest… since this is deprecated, and CARBON is deprecated… that perhaps it might be in your best interest to update your code.

Hi Dave,

my question was NOT, if I should use Carbon or Cocoa … Meanwhile I use Cocoa.

BUT THIS is my question:

If I view this file with a hex editor I can’t find any formatting bytes - so where is it saved? Under Cocoa this is done with backslash chars followed by codes - but as I said - under Carbon it seems to be mystic.

Does anybody know where the format information is stored?

If you want to test it - here is the file:

https://www.dropbox.com/s/w10xi9pv1um370x/Cocaine

If you open it with Text Edit you can see the formatting - if you open it with a hex editor you can’t find format bytes …

I think I’ve found it!

As Michael Diehr mentioned, the style information is hidden in a ressource fork named “styl”.

I’ve found it with a program named “rezycle”.

Off topic, but OMG - visions of Resourcerer just jumped to my mind :slight_smile:

Huh, didn’t know O.M.G was censored…