When processing volume names for the File Browser sidebar lists we are properly handling Windows "wide" characters (UTF-16) as long as they are single wide characters, so below U+FFFF. For characters above this value we get a pair of UTF-16, and end up trying to convert each to UTF-8 as separate UTF-32 values. The result is blank output and a console error that "surrogates not allowed." This PR just does this conversion correctly using utfconv. Pull Request: https://projects.blender.org/blender/blender/pulls/131763
34 lines
563 B
CMake
34 lines
563 B
CMake
# SPDX-FileCopyrightText: 2012-2022 Blender Authors
|
|
#
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
set(INC
|
|
PUBLIC .
|
|
)
|
|
|
|
set(INC_SYS
|
|
|
|
)
|
|
|
|
set(SRC
|
|
utfconv.cc
|
|
|
|
utfconv.hh
|
|
)
|
|
|
|
set(LIB
|
|
)
|
|
|
|
# This is odd but leave it for now...
|
|
# Why have win32 check here? - this is only used for windows.
|
|
# ... because one day we might want to use it on other platforms.
|
|
if(WIN32)
|
|
list(APPEND SRC
|
|
utf_winfunc.cc
|
|
utf_winfunc.hh
|
|
)
|
|
endif()
|
|
|
|
blender_add_lib(bf_intern_utfconv "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
|
|
add_library(bf::intern::utfconv ALIAS bf_intern_utfconv)
|