Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Unable to load dependency files with UTF-8 characters in their name on Linux #426

Closed
LeadRDRK opened this issue Jan 13, 2024 · 2 comments
Assignees

Comments

@LeadRDRK
Copy link

Describe the bug
Dependency files with UTF-8 characters in their name cannot be loaded on Linux.

To Reproduce
Steps to reproduce the behavior:

  1. Click on Open Project (or anything else that needs to open a file)
  2. Select a file that has dependencies which have UTF-8 characters in their names.
  3. Error occurs with garbled file name, or if it's a model, loads with incomplete assets/garbled names.

Same thing happens when using drag and drop. Error seems to occur when the program tries to load the dependencies of a project/model/etc.

Expected behavior
The file should load normally and the file name should not be garbled.

Screenshots
When trying to open a project:
image

When loading a model:
image

Desktop:

  • OS: Arch Linux

Additional context
Built with the following CMake invocation:

cmake -G Ninja .. -DNANOEM_ENABLE_IMGUI_FILE_DIALOG=ON

Without enabling NANOEM_ENABLE_IMGUI_FILE_DIALOG, trying to open anything that needs to select a file does nothing.

@hkrn
Copy link
Owner

hkrn commented Feb 12, 2024

It seems to be a similar case to issue #382. The default build options disable ICU, which is necessary for handling multibyte characters, thus preventing proper processing of multibyte characters.

Please proceed with the following steps to rebuild.

cd /path/to/nanoem/repository
git clone https://github.com/unicode-org/icu/ dependencies/icu
# checkout proper version of ICU4C automatically
cmake -P scripts/build.cmake
cmake -G Ninja .. -DNANOEM_ENABLE_IMGUI_FILE_DIALOG=ON -DNANOEM_ENABLE_BUILD_ICU4C=ON

@LeadRDRK
Copy link
Author

Thank you for your response.

It's more convenient to just link to the system's libraries on Linux, so I ran CMake with these options to build it:

cmake -G Ninja .. -DNANOEM_ENABLE_IMGUI_FILE_DIALOG=ON -DNANOEM_ENABLE_ICU=ON -DICU4C_INCLUDE_DIR=/usr/include/unicode -DICU4C_I18N_LIBRARY_RELEASE=/usr/lib/libicui18n.so -DICU4C_UC_LIBRARY_RELEASE=/usr/lib/libicuuc.so -DICU4C_DATA_LIBRARY_RELEASE=/usr/lib/libicudata.so

The problem is fixed with these options enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants