13f4cbf05Sopenharmony_ci/* 23f4cbf05Sopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd. 33f4cbf05Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 43f4cbf05Sopenharmony_ci * you may not use this file except in compliance with the License. 53f4cbf05Sopenharmony_ci * You may obtain a copy of the License at 63f4cbf05Sopenharmony_ci * 73f4cbf05Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 83f4cbf05Sopenharmony_ci * 93f4cbf05Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 103f4cbf05Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 113f4cbf05Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 123f4cbf05Sopenharmony_ci * See the License for the specific language governing permissions and 133f4cbf05Sopenharmony_ci * limitations under the License. 143f4cbf05Sopenharmony_ci */ 153f4cbf05Sopenharmony_ci#ifndef UTILS_UNICODE_EX_H 163f4cbf05Sopenharmony_ci#define UTILS_UNICODE_EX_H 173f4cbf05Sopenharmony_ci#include <string> 183f4cbf05Sopenharmony_cinamespace OHOS { 193f4cbf05Sopenharmony_cibool String8ToString16(const std::string& str8, std::u16string& str16); 203f4cbf05Sopenharmony_cibool String16ToString8(const std::u16string& str16, std::string& str8); 213f4cbf05Sopenharmony_ciextern "C" { 223f4cbf05Sopenharmony_ci void StrncpyStr16ToStr8(const char16_t* utf16Str, size_t str16Len, char* utf8Str, size_t str8Len); 233f4cbf05Sopenharmony_ci int Utf16ToUtf8Length(const char16_t* str16, size_t str16Len); 243f4cbf05Sopenharmony_ci} 253f4cbf05Sopenharmony_ci} 263f4cbf05Sopenharmony_ci#endif // UTILS_BASE_LOG_H 27