Closed hassandraga closed 11 months ago
❤️ Would be great to have, even essential for some apps!
Coming back to this. What kind of use-case would this serve?
#include "webui.h"
int main() {
size_t my_window = webui_new_window();
webui_show(my_window, "<html><head><script src=\"webui.js\"></script></head>Hello 👋!</html>");
webui_wait();
return 0;
}
While the window for the code above would contain: Hello 👋!
#include "webui.h"
int main() {
size_t my_window = webui_new_window();
webui_show(my_window, "<html><head><meta charset=\"UTF-8\"><script "
"src=\"webui.js\"></script></head>Hello 👋!</html>");
webui_wait();
return 0;
}
Just specifying the html charset is enough to correctly display Hello 👋!
Works
Sorry, I wasn't clear enough in my comment.
I know that. That's why I added Unicode Test
in examples a while ago.
https://github.com/webui-dev/webui/blob/6a634cc680fd7cf0511536ab7302274991489412/examples/C/serve_a_folder/index.html#L50C15-L50C15
<p>
Unicode Test:<br><br>
مرحبًا<br> <!-- Arabic -->
你好<br> <!-- Chinese -->
こんにちは <!-- Japanese -->
</p>
I mean by supporting Unicode in WebUI is to make library able to handl Unicode files name and paths.
This webui_show(win, "/home/ちは/test/こん.html")
won't works right now.
I see, so it's an issue regarding accessibility and internationalisation.
FYI: No wrapper changes are needed.
WebUI does not support Unicode right now. If the local file name, HTML content or any
string
is encoded in a multi-byte format like UTF8, it won't show proper characters in most cases. We can update all WebUI APIs fromchar*
towchar_t*
beside all the needed core changes. This will make WebUI support Unicode.If we did this, some wrappers probably need updates to make strings multi-byte instead of one-byte format (ASCII). Before I process this, I would like to know your thoughts.
V Unicode Nim Unicode TypeScript Unicode Python Unicode Pascal Unicode Go Unicode