[Player-cvs] hxclientkit/src/platform/mac HXStringUtils.c, 1.1.12.2, 1.1.12.3

[Player-cvs] hxclientkit/src/platform/mac HXStringUtils.c, 1.1.12.2, 1.1.12.3

sehancher at helixcommunity.org sehancher at helixcommunity.org
Tue Sep 7 15:02:06 PDT 2004


Update of /cvsroot/player/hxclientkit/src/platform/mac
In directory cvs-new:/tmp/cvs-serv13643

Modified Files:
      Tag: hxclient_1_2_2_neptune
	HXStringUtils.c 
Log Message:
Interpret non UTF8 strings in the system's encoding if it's not Mac Roman. Fixes arabic encoding.

Index: HXStringUtils.c
===================================================================
RCS file: /cvsroot/player/hxclientkit/src/platform/mac/HXStringUtils.c,v
retrieving revision 1.1.12.2
retrieving revision 1.1.12.3
diff -u -d -r1.1.12.2 -r1.1.12.3
--- HXStringUtils.c	31 Jul 2004 00:49:55 -0000	1.1.12.2
+++ HXStringUtils.c	7 Sep 2004 22:02:04 -0000	1.1.12.3
@@ -52,6 +52,11 @@
 	UInt8 testChar;
 	int idx;
 
+	CFStringEncoding systemEncoding = CFStringGetSystemEncoding();
+	if ( systemEncoding == kCFStringEncodingMacRoman )
+	{
+		systemEncoding = kCFStringEncodingWindowsLatin1;
+	}
 	while ( *pszCursor != 0 )
 	{
 		testChar = *pszCursor;
@@ -72,7 +77,7 @@
 			{
 				// high bit is set and it's lacking a UTF-8 group marker
 				// XXXSEH: We're assuming most all content will be encoded either in UTF-8 or in Windows.
-				return kCFStringEncodingWindowsLatin1; // CFStringGetSystemEncoding();
+				return systemEncoding;
 			}
 			
 			for ( idx = 0; idx < groupSize; idx++ )
@@ -82,7 +87,7 @@
 
 				if ( testChar < 0x80 || testChar > 0xBF )
 				{
-					return kCFStringEncodingWindowsLatin1; // CFStringGetSystemEncoding();
+					return systemEncoding;
 				}
 			}
 		}




More information about the Player-cvs mailing list
 

Site Map   |   Terms of Use   |   Privacy Policy   |   Contact Us

Copyright © 1995-2007 RealNetworks, Inc. All rights reserved. RealNetworks and Helix are trademarks of RealNetworks.
All other trademarks or registered trademarks are the property of their respective holders.