sogo icon indicating copy to clipboard operation
sogo copied to clipboard

(fix) NSString+Utilities: Fix safeStringByEscapingXMLString on gnuste…

Open the-nic opened this issue 2 years ago • 1 comments

…p-base-1.28

Newer gnustep version would add a byte-order-mark on NSString:dataUsingEncoding:NSUTF32StringEncoding, use NSUTF32LittleEndianStringEncoding instead to skip the BOM.

Fixes #5416

the-nic avatar Aug 15 '22 14:08 the-nic

Thanks for spotting the issue. The fix looks great for little-endian systems, but just to be really safe we should probably support big endian machines too (even though I'm not aware of any modern machines using a big endian architecture). The GSConfig.h file defines the preprocessor macro GS_WORDS_BIGENDIAN as 1 or 0 to let us make the code handle both cases.

Thanks for the feedback. Howver, I think that should be separate bug, then. there are multiple uses of NSUTF32LittleEndianStringEncoding (e.g. safeString). I'd rather have this fixed asap, and then someone can invest more time for obscure architectures.

the-nic avatar Aug 16 '22 10:08 the-nic

Any plans to merge this fix in the near future?

hirnschmalz avatar Aug 26 '22 09:08 hirnschmalz

Hi team,

Thank you for your contribution to the project.

I agree with @the-nic, as this parameter is used in other code parts, this should not be a new issue. I opened a new ticket for Big endian support : https://bugs.sogo.nu/view.php?id=5615

Sebastien

WoodySlum avatar Oct 04 '22 07:10 WoodySlum