2002-12-31 11:48:36 +00:00
|
|
|
/** Interface for support functions for Unicode implementation.
|
2000-09-30 18:52:11 +00:00
|
|
|
Interface for GetDefEncoding function to determine default c
|
|
|
|
string encoding for GNUstep based on GNUSTEP_STRING_ENCODING
|
|
|
|
environment variable.
|
1998-01-08 15:25:59 +00:00
|
|
|
Copyright (C) 1997 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Written by: Stevo Crvenkovski <stevo@btinternet.com>
|
|
|
|
Date: March 1997
|
2000-09-30 18:52:11 +00:00
|
|
|
Merged with GetDefEncoding.h: Fred Kiefer <fredkiefer@gmx.de>
|
|
|
|
Date: September 2000
|
1998-01-08 15:25:59 +00:00
|
|
|
|
|
|
|
This file is part of the GNUstep Base Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
2007-09-14 11:36:11 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
1998-01-08 15:25:59 +00:00
|
|
|
License as published by the Free Software Foundation; either
|
2008-06-08 10:38:33 +00:00
|
|
|
version 2 of the License, or (at your option) any later version.
|
1998-01-08 15:25:59 +00:00
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
2007-09-14 11:36:11 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2000-02-19 00:40:47 +00:00
|
|
|
License along with this library; if not, write to the Free Software
|
2005-05-22 03:32:16 +00:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
2002-12-31 11:48:36 +00:00
|
|
|
|
|
|
|
AutogsdocSource: Additions/Unicode.m
|
|
|
|
|
1998-01-08 15:25:59 +00:00
|
|
|
*/
|
|
|
|
|
1997-05-03 18:04:21 +00:00
|
|
|
#ifndef __Unicode_h_OBJECTS_INCLUDE
|
|
|
|
#define __Unicode_h_OBJECTS_INCLUDE
|
2010-03-10 14:53:51 +00:00
|
|
|
#import <GNUstepBase/GSVersionMacros.h>
|
1997-05-03 18:04:21 +00:00
|
|
|
|
2007-04-01 11:12:12 +00:00
|
|
|
#import <Foundation/NSString.h> /* For standard string encodings */
|
2000-02-19 00:40:47 +00:00
|
|
|
|
2007-04-01 11:12:12 +00:00
|
|
|
#if OS_API_VERSION(GS_API_NONE,GS_API_LATEST)
|
2004-11-23 10:32:34 +00:00
|
|
|
|
2006-09-13 10:20:49 +00:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2010-03-05 10:24:42 +00:00
|
|
|
#if defined(NeXT_Foundation_LIBRARY)
|
|
|
|
|
|
|
|
/* Taken from base/Headers/Foundation/NSString.h */
|
|
|
|
typedef enum _NSGNUstepStringEncoding
|
|
|
|
{
|
|
|
|
/* NB. Must not have an encoding with value zero - so we can use zero to
|
|
|
|
tell that a variable that should contain an encoding has not yet been
|
|
|
|
initialised */
|
|
|
|
GSUndefinedEncoding = 0,
|
|
|
|
|
|
|
|
// GNUstep additions
|
|
|
|
NSKOI8RStringEncoding = 50, // Russian/Cyrillic
|
|
|
|
NSISOLatin3StringEncoding = 51, // ISO-8859-3; South European
|
|
|
|
NSISOLatin4StringEncoding = 52, // ISO-8859-4; North European
|
|
|
|
NSISOCyrillicStringEncoding = 22, // ISO-8859-5
|
|
|
|
NSISOArabicStringEncoding = 53, // ISO-8859-6
|
|
|
|
NSISOGreekStringEncoding = 54, // ISO-8859-7
|
|
|
|
NSISOHebrewStringEncoding = 55, // ISO-8859-8
|
|
|
|
NSISOLatin5StringEncoding = 57, // ISO-8859-9; Turkish
|
|
|
|
NSISOLatin6StringEncoding = 58, // ISO-8859-10; Nordic
|
|
|
|
NSISOThaiStringEncoding = 59, // ISO-8859-11
|
|
|
|
/* Possible future ISO-8859 additions
|
|
|
|
// ISO-8859-12
|
|
|
|
*/
|
|
|
|
NSISOLatin7StringEncoding = 61, // ISO-8859-13
|
|
|
|
NSISOLatin8StringEncoding = 62, // ISO-8859-14
|
|
|
|
NSISOLatin9StringEncoding = 63, // ISO-8859-15; Replaces ISOLatin1
|
|
|
|
NSGB2312StringEncoding = 56,
|
|
|
|
NSUTF7StringEncoding = 64, // RFC 2152
|
|
|
|
NSGSM0338StringEncoding, // GSM (mobile phone) default alphabet
|
|
|
|
NSBIG5StringEncoding, // Traditional chinese
|
|
|
|
NSKoreanEUCStringEncoding,
|
2013-07-04 06:30:35 +00:00
|
|
|
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4,GS_API_ANY)
|
2013-07-04 06:29:06 +00:00
|
|
|
NSUTF16BigEndianStringEncoding = 0x90000100,
|
|
|
|
NSUTF16LittleEndianStringEncoding = 0x94000100,
|
|
|
|
NSUTF32StringEncoding = 0x8c000100,
|
|
|
|
NSUTF32BigEndianStringEncoding = 0x98000100,
|
|
|
|
NSUTF32LittleEndianStringEncoding = 0x9c000100,
|
2010-03-05 10:24:42 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
GSEncodingUnusedLast
|
|
|
|
} NSGNUstepStringEncoding;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2006-10-09 14:00:01 +00:00
|
|
|
#if GS_API_VERSION(GS_API_NONE,011500)
|
|
|
|
/* Deprecated functions */
|
2002-10-22 03:22:30 +00:00
|
|
|
GS_EXPORT NSStringEncoding GSEncodingFromLocale(const char *clocale);
|
|
|
|
GS_EXPORT NSStringEncoding GSEncodingForRegistry(NSString *registry,
|
2006-10-29 09:17:05 +00:00
|
|
|
NSString *encoding);
|
2001-07-30 19:36:39 +00:00
|
|
|
GS_EXPORT unichar uni_tolower(unichar ch);
|
|
|
|
GS_EXPORT unichar uni_toupper(unichar ch);
|
2006-10-29 09:17:05 +00:00
|
|
|
|
2001-07-30 19:36:39 +00:00
|
|
|
GS_EXPORT unsigned char uni_cop(unichar u);
|
|
|
|
GS_EXPORT BOOL uni_isnonsp(unichar u);
|
|
|
|
GS_EXPORT unichar *uni_is_decomp(unichar u);
|
2006-10-29 09:17:05 +00:00
|
|
|
GS_EXPORT unsigned GSUnicode(const unichar *chars, unsigned length,
|
|
|
|
BOOL *isASCII, BOOL *isLatin1);
|
2006-10-09 14:00:01 +00:00
|
|
|
#endif
|
1997-05-03 18:04:21 +00:00
|
|
|
|
2002-12-31 11:48:36 +00:00
|
|
|
|
2002-03-14 15:27:12 +00:00
|
|
|
/*
|
|
|
|
* Options when converting strings.
|
|
|
|
*/
|
|
|
|
#define GSUniTerminate 0x01
|
|
|
|
#define GSUniTemporary 0x02
|
|
|
|
#define GSUniStrict 0x04
|
2002-03-16 09:54:50 +00:00
|
|
|
#define GSUniBOM 0x08
|
|
|
|
#define GSUniShortOk 0x10
|
2002-03-14 15:27:12 +00:00
|
|
|
|
|
|
|
GS_EXPORT BOOL GSFromUnicode(unsigned char **dst, unsigned int *size,
|
|
|
|
const unichar *src, unsigned int slen, NSStringEncoding enc, NSZone *zone,
|
|
|
|
unsigned int options);
|
|
|
|
GS_EXPORT BOOL GSToUnicode(unichar **dst, unsigned int *size,
|
|
|
|
const unsigned char *src, unsigned int slen, NSStringEncoding enc,
|
|
|
|
NSZone *zone, unsigned int options);
|
|
|
|
|
2006-09-13 10:20:49 +00:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2006-10-09 18:32:11 +00:00
|
|
|
#endif /* OS_API_VERSION(GS_API_NONE,GS_API_NONE) */
|
2002-03-14 15:27:12 +00:00
|
|
|
|
1997-05-03 18:04:21 +00:00
|
|
|
#endif /* __Unicode_h_OBJECTS_INCLUDE */
|