+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
*
-* Copyright (C) 1999-2010, International Business Machines
+* Copyright (C) 1999-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
* file name: unistr_cnv.cpp
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:2
*
#if !U_CHARSET_IS_UTF8
-UnicodeString::UnicodeString(const char *codepageData)
- : fShortLength(0),
- fFlags(kShortString)
-{
+UnicodeString::UnicodeString(const char *codepageData) {
+ fUnion.fFields.fLengthAndFlags = kShortString;
if(codepageData != 0) {
doCodepageCreate(codepageData, (int32_t)uprv_strlen(codepageData), 0);
}
}
UnicodeString::UnicodeString(const char *codepageData,
- int32_t dataLength)
- : fShortLength(0),
- fFlags(kShortString)
-{
+ int32_t dataLength) {
+ fUnion.fFields.fLengthAndFlags = kShortString;
if(codepageData != 0) {
doCodepageCreate(codepageData, dataLength, 0);
}
#endif
UnicodeString::UnicodeString(const char *codepageData,
- const char *codepage)
- : fShortLength(0),
- fFlags(kShortString)
-{
+ const char *codepage) {
+ fUnion.fFields.fLengthAndFlags = kShortString;
if(codepageData != 0) {
doCodepageCreate(codepageData, (int32_t)uprv_strlen(codepageData), codepage);
}
UnicodeString::UnicodeString(const char *codepageData,
int32_t dataLength,
- const char *codepage)
- : fShortLength(0),
- fFlags(kShortString)
-{
+ const char *codepage) {
+ fUnion.fFields.fLengthAndFlags = kShortString;
if(codepageData != 0) {
doCodepageCreate(codepageData, dataLength, codepage);
}
UnicodeString::UnicodeString(const char *src, int32_t srcLength,
UConverter *cnv,
- UErrorCode &errorCode)
- : fShortLength(0),
- fFlags(kShortString)
-{
+ UErrorCode &errorCode) {
+ fUnion.fFields.fLengthAndFlags = kShortString;
if(U_SUCCESS(errorCode)) {
// check arguments
if(src==NULL) {