Imported Upstream version 58.1
[platform/upstream/icu.git] / source / tools / toolutil / udbgutil.cpp
index 819cbd9..bbb814b 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /********************************************************************
  * COPYRIGHT:
  * Copyright (c) 2007-2016, International Business Machines Corporation and
@@ -13,6 +15,7 @@
 #include "unicode/ulocdata.h"
 #include "unicode/ucnv.h"
 #include "unicode/unistr.h"
+#include "cstr.h"
 
 /*
 To add a new enum type
@@ -689,8 +692,9 @@ void KnownIssues::add(const char *ticket, const char *where, const UChar *msg, U
   }
   if(msg==NULL || !*msg) return;
 
-  std::string str;
-  fTable[ticket][where].insert(icu::UnicodeString(msg).toUTF8String(str));
+  const icu::UnicodeString ustr(msg);
+
+  fTable[ticket][where].insert(std::string(icu::CStr(ustr)()));
 }
 
 void KnownIssues::add(const char *ticket, const char *where, const char *msg, UBool *firstForTicket, UBool *firstForWhere)