Skip to content

Commit

Permalink
import from upstram tarball icu4c-4_6_1-src.tgz
Browse files Browse the repository at this point in the history
  • Loading branch information
Islam Amer committed Mar 23, 2014
1 parent 28d9e0e commit 19aef60
Show file tree
Hide file tree
Showing 45 changed files with 2,489 additions and 1,638 deletions.
2 changes: 1 addition & 1 deletion license.html
Expand Up @@ -11,7 +11,7 @@ <h2>ICU License - ICU 1.8.1 and later</h2>
<p>COPYRIGHT AND PERMISSION NOTICE</p>

<p>
Copyright (c) 1995-2010 International Business Machines Corporation and others
Copyright (c) 1995-2011 International Business Machines Corporation and others
</p>
<p>
All rights reserved.
Expand Down
12 changes: 6 additions & 6 deletions readme.html
Expand Up @@ -4,9 +4,9 @@
<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
<head>

<title>ReadMe for ICU 4.6</title>
<title>ReadMe for ICU 4.6.1</title>
<meta name="COPYRIGHT" content=
"Copyright (c) 1997-2010 IBM Corporation and others. All Rights Reserved." />
"Copyright (c) 1997-2011 IBM Corporation and others. All Rights Reserved." />
<meta name="KEYWORDS" content=
"ICU; International Components for Unicode; ICU4C; what's new; readme; read me; introduction; downloads; downloading; building; installation;" />
<meta name="DESCRIPTION" content=
Expand All @@ -17,10 +17,10 @@

<body class="draft">
<h1>International Components for Unicode<br />
<abbr title="International Components for Unicode">ICU</abbr> 4.6 ReadMe</h1>
<abbr title="International Components for Unicode">ICU</abbr> 4.6.1 ReadMe</h1>

<p>Last updated: 2010-Dec-01<br />
Copyright &copy; 1997-2010 International Business Machines Corporation and
<p>Last updated: 2011-Mar-08<br />
Copyright &copy; 1997-2011 International Business Machines Corporation and
others. All Rights Reserved.</p>
<!-- Remember that there is a copyright at the end too -->
<hr />
Expand Down Expand Up @@ -1665,7 +1665,7 @@ <h3><a name="PlatformDependenciesImpl" href="#PlatformDependenciesImpl" id=
</ul>
<hr />

<p>Copyright &copy; 1997-2010 International Business Machines Corporation and
<p>Copyright &copy; 1997-2011 International Business Machines Corporation and
others. All Rights Reserved.<br />
IBM Globalization Center of Competency - San Jos&eacute;<br />
4400 North First Street<br />
Expand Down
20 changes: 17 additions & 3 deletions source/common/loclikely.cpp
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
* Copyright (C) 1997-2010, International Business Machines
* Copyright (C) 1997-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
Expand Down Expand Up @@ -325,9 +325,14 @@ createTagStringWithAlternates(
}

if (trailingLength > 0) {
if (capacityRemaining > 0 && !regionAppended) {
if (*trailing != '@' && capacityRemaining > 0) {
tag[tagLength++] = '_';
--capacityRemaining;
if (capacityRemaining > 0 && !regionAppended) {
/* extra separator is required */
tag[tagLength++] = '_';
--capacityRemaining;
}
}

if (capacityRemaining > 0) {
Expand Down Expand Up @@ -546,6 +551,9 @@ parseTagString(
**/
*regionLength = 0;
}
} else if (*position != 0 && *position != '@') {
/* back up over consumed trailing separator */
--position;
}

exit:
Expand Down Expand Up @@ -883,6 +891,9 @@ _uloc_addLikelySubtags(const char* localeID,
}

/* Find the length of the trailing portion. */
while (_isIDSeparator(localeID[trailingIndex])) {
trailingIndex++;
}
trailing = &localeID[trailingIndex];
trailingLength = (int32_t)uprv_strlen(trailing);

Expand Down Expand Up @@ -987,7 +998,10 @@ _uloc_minimizeSubtags(const char* localeID,
goto error;
}

/* Find the spot where the variants begin, if any. */
/* Find the spot where the variants or the keywords begin, if any. */
while (_isIDSeparator(localeID[trailingIndex])) {
trailingIndex++;
}
trailing = &localeID[trailingIndex];
trailingLength = (int32_t)uprv_strlen(trailing);

Expand Down
51 changes: 49 additions & 2 deletions source/common/uloc_tag.c
@@ -1,6 +1,6 @@
/*
**********************************************************************
* Copyright (C) 2009-2010, International Business Machines
* Copyright (C) 2009-2011, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
*/
Expand All @@ -14,6 +14,7 @@
#include "cstring.h"
#include "putilimp.h"
#include "uinvchar.h"
#include "ulocimp.h"

/* struct holding a single variant */
typedef struct VariantListEntry {
Expand Down Expand Up @@ -2194,6 +2195,7 @@ uloc_toLanguageTag(const char* localeID,
int32_t reslen = 0;
UErrorCode tmpStatus = U_ZERO_ERROR;
UBool hadPosix = FALSE;
const char* pKeywordStart;

/* Note: uloc_canonicalize returns "en_US_POSIX" for input locale ID "". See #6835 */
canonical[0] = 0;
Expand All @@ -2205,6 +2207,51 @@ uloc_toLanguageTag(const char* localeID,
}
}

/* For handling special case - private use only tag */
pKeywordStart = locale_getKeywordsStart(canonical);
if (pKeywordStart == canonical) {
UEnumeration *kwdEnum;
int kwdCnt = 0;
UBool done = FALSE;

kwdEnum = uloc_openKeywords((const char*)canonical, &tmpStatus);
if (kwdEnum != NULL) {
kwdCnt = uenum_count(kwdEnum, &tmpStatus);
if (kwdCnt == 1) {
const char *key;
int32_t len = 0;

key = uenum_next(kwdEnum, &len, &tmpStatus);
if (len == 1 && *key == PRIVATEUSE) {
char buf[ULOC_KEYWORD_AND_VALUES_CAPACITY];
buf[0] = PRIVATEUSE;
buf[1] = SEP;
len = uloc_getKeywordValue(localeID, key, &buf[2], sizeof(buf) - 2, &tmpStatus);
if (U_SUCCESS(tmpStatus)) {
if (_isPrivateuseValueSubtags(&buf[2], len)) {
/* return private use only tag */
reslen = len + 2;
uprv_memcpy(langtag, buf, uprv_min(reslen, langtagCapacity));
u_terminateChars(langtag, langtagCapacity, reslen, status);
done = TRUE;
} else if (strict) {
*status = U_ILLEGAL_ARGUMENT_ERROR;
done = TRUE;
}
/* if not strict mode, then "und" will be returned */
} else {
*status = U_ILLEGAL_ARGUMENT_ERROR;
done = TRUE;
}
}
}
uenum_close(kwdEnum);
if (done) {
return reslen;
}
}
}

reslen += _appendLanguageToLanguageTag(canonical, langtag, langtagCapacity, strict, status);
reslen += _appendScriptToLanguageTag(canonical, langtag + reslen, langtagCapacity - reslen, strict, status);
reslen += _appendRegionToLanguageTag(canonical, langtag + reslen, langtagCapacity - reslen, strict, status);
Expand Down Expand Up @@ -2321,7 +2368,7 @@ uloc_forLanguageTag(const char* langtag,
n = ultag_getExtensionsSize(lt);
subtag = ultag_getPrivateUse(lt);
if (n > 0 || uprv_strlen(subtag) > 0) {
if (reslen == 0) {
if (reslen == 0 && n > 0) {
/* need a language */
if (reslen < localeIDCapacity) {
uprv_memcpy(localeID + reslen, LANG_UND, uprv_min(LANG_UND_LEN, localeIDCapacity - reslen));
Expand Down
57 changes: 22 additions & 35 deletions source/common/unicode/uvernum.h
@@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 2000-2010, International Business Machines
* Copyright (C) 2000-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
*
Expand All @@ -22,7 +22,7 @@
* The following files need to be updated as well, which can be done
* by running the UNIX makefile target 'update-windows-makefiles' in icu/source.
*
*
*
* source/common/common.vcproj - update 'Output file name' on the link tab so
* that it contains the new major/minor combination
* source/i18n/i18n.vcproj - same as for the common.vcproj
Expand All @@ -42,7 +42,7 @@
* @stable ICU 2.4
*/
#define U_COPYRIGHT_STRING \
" Copyright (C) 2010, International Business Machines Corporation and others. All Rights Reserved. "
" Copyright (C) 2011, International Business Machines Corporation and others. All Rights Reserved. "

/** The current ICU major version as an integer.
* This value will change in the subsequent releases of ICU
Expand All @@ -60,7 +60,7 @@
* This value will change in the subsequent releases of ICU
* @stable ICU 2.4
*/
#define U_ICU_VERSION_PATCHLEVEL_NUM 0
#define U_ICU_VERSION_PATCHLEVEL_NUM 1

/** The current ICU build level version as an integer.
* This value is for use by ICU clients. It defaults to 0.
Expand Down Expand Up @@ -91,7 +91,7 @@
* This value will change in the subsequent releases of ICU
* @stable ICU 2.4
*/
#define U_ICU_VERSION "4.6"
#define U_ICU_VERSION "4.6.1"

/** The current ICU library major/minor version as a string without dots, for library name suffixes.
* This value will change in the subsequent releases of ICU
Expand All @@ -105,47 +105,34 @@
#define U_ICU_DATA_VERSION "4.6"

/*===========================================================================
* ICU collation framework version information
* Version info that can be obtained from a collator is affected by these
* ICU collation framework version information
* Version info that can be obtained from a collator is affected by these
* numbers in a secret and magic way. Please use collator version as whole
*===========================================================================
*/

/** Collation runtime version (sort key generator, strcoll).
* If the version is different, sortkeys for the same string could be different
* version 2 was in ICU 1.8.1. changed is: compression intervals, French secondary
* compression, generating quad level always when strength is quad or more
* version 4 - ICU 2.2 - tracking UCA changes, ignore completely ignorables
* in contractions, ignore primary ignorables after shifted
* version 5 - ICU 2.8 - changed implicit generation code
* version 6 - ICU 3.4 - with the UCA 4.1, Thai tag is no longer generated or used
* This value may change in the subsequent releases of ICU
/**
* Collation runtime version (sort key generator, strcoll).
* If the version is different, sort keys for the same string could be different.
* This value may change in subsequent releases of ICU.
* @stable ICU 2.4
*/
#define UCOL_RUNTIME_VERSION 6

/** Builder code version. When this is different, same tailoring might result
* in assigning different collation elements to code points
* version 2 was in ICU 1.8.1. added support for prefixes, tweaked canonical
* closure. However, the tailorings should probably get same CEs assigned
* version 5 - ICU 2.2 - fixed some bugs, renamed some indirect values.
* version 6 - ICU 2.8 - fixed bug in builder that allowed 0xFF in primary values
* version 7 - ICU 3.4 - with the UCA 4.1 Thai tag is no longer processed, complete ignorables
* now break contractions
* version 8 - ICU 4.6 - the addition of collation reordering. It should in general be
* compatible since the data is at the end of the file. However,
* if data parsers make assumptions about lengths this will cause problems.
* Backward compatible with the old rules.
* This value may change in the subsequent releases of ICU
#define UCOL_RUNTIME_VERSION 7

/**
* Collation builder code version.
* When this is different, the same tailoring might result
* in assigning different collation elements to code points.
* This value may change in subsequent releases of ICU.
* @stable ICU 2.4
*/
#define UCOL_BUILDER_VERSION 8

/** This is the version of the tailorings
* This value may change in the subsequent releases of ICU
* @stable ICU 2.4
/**
* This is the version of collation tailorings.
* This value may change in subsequent releases of ICU.
* @stable ICU 2.4
*/
#define UCOL_TAILORINGS_VERSION 1


#endif
8 changes: 4 additions & 4 deletions source/common/utext.cpp
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
* Copyright (C) 2005-2010, International Business Machines
* Copyright (C) 2005-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
Expand Down Expand Up @@ -2846,7 +2846,7 @@ ucstrTextExtract(UText *ut,
return 0;
}

const UChar *s=(const UChar *)ut->context;
//const UChar *s=(const UChar *)ut->context;
int32_t si, di;

int32_t start32;
Expand All @@ -2856,8 +2856,8 @@ ucstrTextExtract(UText *ut,
// Pins 'start' to the length of the string, if it came in out-of-bounds.
// Snaps 'start' to the beginning of a code point.
ucstrTextAccess(ut, start, TRUE);
U_ASSERT(start <= INT32_MAX);
start32 = (int32_t)start;
const UChar *s=ut->chunkContents;
start32 = ut->chunkOffset;

int32_t strLength=(int32_t)ut->a;
if (strLength >= 0) {
Expand Down
4 changes: 2 additions & 2 deletions source/config/mh-aix-va
Expand Up @@ -123,11 +123,11 @@ $(LIBDIR)/%.a : %.so

%.u : $(srcdir)/%.c
@echo "generating dependency information for $<"
@$(SHELL) -ec '$(GEN_DEPS.c) $< > /dev/null'
@$(GEN_DEPS.c) $< > /dev/null

%.u : $(srcdir)/%.cpp
@echo "generating dependency information for $<"
@$(SHELL) -ec '$(GEN_DEPS.cc) $< > /dev/null'
@$(GEN_DEPS.cc) $< > /dev/null

## Versioned libraries rules
%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
Expand Down
Binary file modified source/data/in/icudt46l.dat
Binary file not shown.
6 changes: 3 additions & 3 deletions source/data/misc/icuver.txt
@@ -1,11 +1,11 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// *
// ***************************************************************************

icuver:table(nofallback){
DataVersion { "4.6.0.0" }
ICUVersion { "4.6.0.0" }
DataVersion { "4.6.1.0" }
ICUVersion { "4.6.1.0" }
}
2 changes: 1 addition & 1 deletion source/data/misc/keyTypeData.txt
@@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/bcp47/*.xml
Expand Down
2 changes: 1 addition & 1 deletion source/data/misc/likelySubtags.txt
@@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/likelySubtags.xml
Expand Down

0 comments on commit 19aef60

Please sign in to comment.