@@ -97,10 +97,12 @@ size_t, bool); extern bool of_unicode_to_codepage_437(const of_unichar_t*, unsigned char*, size_t, bool); extern bool of_unicode_to_codepage_850(const of_unichar_t*, unsigned char*, size_t, bool); +extern bool of_unicode_to_codepage_858(const of_unichar_t*, unsigned char*, + size_t, bool); extern bool of_unicode_to_mac_roman(const of_unichar_t*, unsigned char*, size_t, bool); /* References for static linking */ void @@ -1115,10 +1117,21 @@ (unsigned char*)cString, length, lossy)) @throw [OFInvalidEncodingException exception]; cString[length] = '\0'; + return length; + case OF_STRING_ENCODING_CODEPAGE_858: + if (length + 1 > maxLength) + @throw [OFOutOfRangeException exception]; + + if (!of_unicode_to_codepage_858(characters, + (unsigned char*)cString, length, lossy)) + @throw [OFInvalidEncodingException exception]; + + cString[length] = '\0'; + return length; case OF_STRING_ENCODING_MAC_ROMAN: if (length + 1 > maxLength) @throw [OFOutOfRangeException exception]; @@ -1186,10 +1199,11 @@ case OF_STRING_ENCODING_ISO_8859_15: case OF_STRING_ENCODING_WINDOWS_1251: case OF_STRING_ENCODING_WINDOWS_1252: case OF_STRING_ENCODING_CODEPAGE_437: case OF_STRING_ENCODING_CODEPAGE_850: + case OF_STRING_ENCODING_CODEPAGE_858: case OF_STRING_ENCODING_MAC_ROMAN: cString = [object allocMemoryWithSize: length + 1]; [self OF_getCString: cString maxLength: length + 1 @@ -1253,10 +1267,11 @@ case OF_STRING_ENCODING_ISO_8859_15: case OF_STRING_ENCODING_WINDOWS_1251: case OF_STRING_ENCODING_WINDOWS_1252: case OF_STRING_ENCODING_CODEPAGE_437: case OF_STRING_ENCODING_CODEPAGE_850: + case OF_STRING_ENCODING_CODEPAGE_858: case OF_STRING_ENCODING_MAC_ROMAN: return [self length]; default: @throw [OFInvalidEncodingException exception]; }