Applying Decomposed UTF-8 Patch to OOo-X11 1.1.4
James McKenzie <[email protected]>
| Newsgroups | gmane.comp.openoffice.devel.porting |
|---|---|
| Message-ID | <[email protected]> |
Eric B:
I attempted to apply the Decomposed UTF-8 patch to sal/osl/unx/file.c
for OOo-X11 1.1.4 srx645_m54 and the second part will not apply even
after I edited the patch to match the code in file.c.
Here is the patch as edited after applying the first part:
--- file.c 2005-01-25 14:47:51.000000000 +0100
+++ file_macosx07.c 2005-05-16 22:27:40.000000000 +0200
@@ -440,13 +449,28 @@
if (NULL == pEntry)
return osl_File_E_NOENT;
+
+#if defined(MACOSX) && (BUILD_OS_MAJOR==10) && (BUILD_OS_MINOR>=2)
+
+ // convert decomposed filename to precomposed unicode
+ char composed_name[BUFSIZ];
+ CFMutableStringRef strRef = CFStringCreateMutable (NULL, 0 );
+ CFStringAppendCString( strRef, pEntry->d_name,
kCFStringEncodingUTF8 ); //UTF8 is default on Mac OSX
+ CFStringNormalize( strRef, kCFStringNormalizationFormC );
+ CFStringGetCString( strRef, composed_name, BUFSIZ,
kCFStringEncodingUTF8 );
+ CFRelease( strRef );
+ rtl_string2UString( &ustrFileName, composed_name, strlen(
composed_name),
+ osl_getThreadTextEncoding(), OSTRING_TO_OUSTRING_CVTFLAGS );
+
+#else // not MACOSX
/* convert file name to unicode */
rtl_string2UString( &ustrFileName, pEntry->d_name, strlen(
pEntry->d_name ),
osl_getThreadTextEncoding(), OSTRING_TO_OUSTRING_CVTFLAGS );
OSL_ASSERT(ustrFileName != 0);
- osl_systemPathMakeAbsolutePath(pDirImpl->ustrPath, ustrFileName,
&ustrFilePath);
+#endif
+ osl_systemPathMakeAbsolutePath(pDirImpl->ustrPath, ustrFileName,
&ustrFilePath);
rtl_uString_release( ustrFileName );
/* use path as directory item */
Any idea why the patch will not apply? Anyone else successful in
applying this patch?
Thank you.
James McKenzie