-
Notifications
You must be signed in to change notification settings - Fork 28
fix(encoding): UTF-8 support for European characters #190
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
fix(encoding): UTF-8 support for European characters #190
Conversation
- Set UTF-8 locale at application startup before any file I/O - Fix JSON file reading to properly handle UTF-8 encoding - Add European font fallback for Croatian characters (č, ć, đ, š, ž) - Fix search history file reading/writing with UTF-8 - Set environment variables (LC_ALL, LANG) for proper locale handling Fixes issue where Croatian characters displayed as replacement characters (□) on PS4 and PC platforms. Characters now render correctly in titles, descriptions, and search results. Tested on Linux desktop with Croatian content from Jellyfin server.
|
change for library/borealis is not necessary |
app/src/tab/search_tab.cpp
Outdated
| this->path = AppConfig::instance().configDir() + "/search.json"; | ||
| std::ifstream readFile(this->path); | ||
| #if !defined(USE_BOOST_FILESYSTEM) || defined(_WIN32) | ||
| std::ifstream readFile(fs::u8path(this->path), std::ios::binary); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's for filename, not file content
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great thanks
…cters - Set UTF-8 locale at application startup before any file I/O operations - Fixed JSON file reading to properly handle UTF-8 encoding (search history) - Set environment variables (LC_ALL, LANG) for proper locale handling - Simplified search history file I/O (removed unnecessary fs::u8path for content) Fixes issue where Croatian (č, ć, đ, š, ž) and Arabic characters displayed as replacement characters (□) on PS4 and PC platforms. Characters now render correctly in titles, descriptions, and search results. Note: Font fallback for Arabic may need to be added separately if system fonts don't support Arabic characters. The UTF-8 encoding fixes ensure proper character parsing and display when fonts are available. Tested on Linux desktop with Croatian content from Jellyfin server.
|
@bestopensors this build updated font load, tested with windows
|
a9b2b05 to
d58d455
Compare
|
I can't test on windows unfortunately |
@bestopensors Can you help test the PS4 version of https://nightly.link/dragonflylee/switchfin/actions/runs/20980863997 ? |
|
yes I can do that |
|
@dragonflylee the utf encoding implemented in this pr (croatian/european) works on PS4 also |
However, there is still a lot of redundant code here, and it cannot be compiled successfully on Windows. It seems to be AI-generated code. |
- Remove nested try-catch blocks and setenv() calls (not available on Windows) - Simplify locale setup to basic setlocale() call - Fix Windows compilation issues from previous PR
a75b9ab to
b6a7707
Compare
removed some of the redundant code, everything still works on linux. Yes the code is "kind of" AI generated but I will try to be more careful not to bloat everything. |
|
If you could send me the latest build with these changes, I will gladly test on ps4. |
|
@bestopensors The key modifications have been included in 3b3c632c |
|
PS4 version works very nicely :) |

Description
Fixed UTF-8 encoding issues that caused Croatian characters (č, ć, đ, š, ž) to display as replacement characters (□) on PS4 and PC platforms.
Changes
Files Changed
app/src/main.cpp- UTF-8 locale setupapp/src/tab/search_tab.cpp- UTF-8 file reading/writinglibrary/borealis/library/lib/core/i18n.cpp- UTF-8 JSON parsinglibrary/borealis/library/lib/platforms/desktop/desktop_font.cpp- European font fallback.gitignore- Added build scriptsTesting
✅ Tested on Linux desktop with Croatian content from Jellyfin server
✅ Characters now render correctly in:
Screenshots
before:


after:


Platform Support
Fixes issue where Croatian characters displayed as replacement characters.