Files
sdk/runtime/bin/icu.cc
Ryan Macnak cbb4176bea Roll icu to 43953f57b037778a1b8005564afabe214834f7bd.
Embed the Flutter version of icutl.dat to keep \p{Emoji} etc working.

TEST=corelib/regexp/unicode-property-binary_test
Bug: https://github.com/dart-lang/sdk/issues/50248
Change-Id: I91124690160fead3e1ba841f4244595ba338387c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/375180
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-07-17 16:47:50 +00:00

35 lines
779 B
C++

// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include "bin/icu.h"
#include "unicode/udata.h"
#include "platform/assert.h"
#if defined(DART_EMBED_ICU_DATA)
extern "C" const uint8_t kIcuData[];
#endif
namespace dart {
namespace bin {
#if defined(DART_EMBED_ICU_DATA)
const uint8_t* icu_data = kIcuData;
#endif
void SetupICU() {
#if defined(DART_EMBED_ICU_DATA)
// Setup ICU.
UErrorCode err_code = U_ZERO_ERROR;
udata_setCommonData(icu_data, &err_code);
if (err_code != U_ZERO_ERROR) {
FATAL("Failed to initialize ICU: %d\n", err_code);
}
#endif
}
} // namespace bin
} // namespace dart