diff options
author | Kurt Zenker <kz@openoffice.org> | 2005-05-31 16:07:41 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2005-05-31 16:07:41 +0000 |
commit | 8148064fc52f17f634e263ba694cec6a33c5fefd (patch) | |
tree | 275c40f635abe59630da9cac1cde5731b3c77fad /sal/osl/unx/file.cxx | |
parent | c0a82ec8a31f9f50ddb787846f3ec7b03495de8e (diff) |
INTEGRATION: CWS macosx07 (1.7.38); FILE MERGED
2005/05/05 23:55:19 ericb 1.7.38.1: i44530 UTF8 is used for dirnames and filenames in MacOSX
Diffstat (limited to 'sal/osl/unx/file.cxx')
-rw-r--r-- | sal/osl/unx/file.cxx | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index 75c72b53e..4084ac9cd 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -2,9 +2,9 @@ * * $RCSfile: file.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: obo $ $Date: 2005-01-25 13:47:51 $ + * last change: $Author: kz $ $Date: 2005-05-31 17:07:41 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -168,6 +168,15 @@ static const sal_Char* MOUNTTAB="/etc/mtab"; #include <sys/mount.h> #define HAVE_STATFS_H + +#define osl_getThreadTextEncoding() RTL_TEXTENCODING_UTF8 + +// add MACOSX Time Value + +#define TimeValue CFTimeValue +#include <CoreFoundation/CoreFoundation.h> +#undef TimeValue + #endif #if OSL_DEBUG_LEVEL > 1 @@ -440,13 +449,28 @@ oslFileError SAL_CALL osl_getNextDirectoryItem(oslDirectory Directory, oslDirect 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 */ |