hey list,
I'm trying to support NSNib in nib2cib. In Apple nib files, NSNibs are represented as base64 data.
Inside NS_InitWithCoder: i can get the correct data with the correct bytes array. Then i need to write it in a file in order to nib2cib again the resulting nib.
I tried this:
var utf16String = CFData.bytesToUtf16String(data.bytes());
require("file").write("NSNib.nib", utf16String, { charset:"UTF-16" }); // UTF-16 because ibtool requires it. right ?
But unfortunately i don't get the excpected content. The file exist but some characters differ from what i get using NSData writeToFile: and ibtool says the file is corrupted. It's hard to say why: because of the bytes->string conversion or the writing process.
Is there something obvious i'm missing here ?
Another possibility would be to write data directly from the bytes array to avoid any problems with encoding. Is there a way to do this in narwhal ?