summaryrefslogtreecommitdiff
path: root/dtrans/source/win32/misc
diff options
context:
space:
mode:
authorTino Rachui <tra@openoffice.org>2001-03-19 12:03:00 +0000
committerTino Rachui <tra@openoffice.org>2001-03-19 12:03:00 +0000
commitb97f7daa1003c93eb546c17d2fc3790277d02956 (patch)
tree618a72fae1b461b7d493fa76002fb7817ee89261 /dtrans/source/win32/misc
parentfab5a6d72b7c6940a0bb60315354f2161a78db1a (diff)
*** empty log message ***
Diffstat (limited to 'dtrans/source/win32/misc')
-rw-r--r--dtrans/source/win32/misc/ImplHelper.cxx36
1 files changed, 20 insertions, 16 deletions
diff --git a/dtrans/source/win32/misc/ImplHelper.cxx b/dtrans/source/win32/misc/ImplHelper.cxx
index b72f6c64568b..0d7888cb6984 100644
--- a/dtrans/source/win32/misc/ImplHelper.cxx
+++ b/dtrans/source/win32/misc/ImplHelper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ImplHelper.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: tra $ $Date: 2001-03-19 09:12:05 $
+ * last change: $Author: tra $ $Date: 2001-03-19 13:03:00 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -108,24 +108,28 @@ using ::rtl::OString;
sal_uInt32 SAL_CALL getWinCPFromMimeCharset( const OUString& charset )
{
- OString osCharset(
- charset.getStr( ), charset.getLength( ), RTL_TEXTENCODING_ASCII_US );
+ sal_uInt32 winCP = GetACP( );
- rtl_TextEncoding txtEnc =
- rtl_getTextEncodingFromMimeCharset( osCharset.getStr( ) );
+ if ( charset.getLength( ) )
+ {
+ OString osCharset(
+ charset.getStr( ), charset.getLength( ), RTL_TEXTENCODING_ASCII_US );
- sal_uInt32 winChrs = rtl_getBestWindowsCharsetFromTextEncoding( txtEnc );
+ rtl_TextEncoding txtEnc =
+ rtl_getTextEncodingFromMimeCharset( osCharset.getStr( ) );
- CHARSETINFO chrsInf;
- sal_Bool bRet = TranslateCharsetInfo(
- (DWORD*)winChrs, &chrsInf, TCI_SRCCHARSET );
+ sal_uInt32 winChrs = rtl_getBestWindowsCharsetFromTextEncoding( txtEnc );
- // if one of the above functions fails
- // we will return the current ANSI codepage
- // of this thread
- sal_uInt32 winCP = GetACP( );
- if ( bRet )
- winCP = chrsInf.ciACP;
+ CHARSETINFO chrsInf;
+ sal_Bool bRet = TranslateCharsetInfo(
+ (DWORD*)winChrs, &chrsInf, TCI_SRCCHARSET );
+
+ // if one of the above functions fails
+ // we will return the current ANSI codepage
+ // of this thread
+ if ( bRet )
+ winCP = chrsInf.ciACP;
+ }
return winCP;
}