-
-
Notifications
You must be signed in to change notification settings - Fork 376
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
UNICODE fixes (clipboard, window title, file dialogs, paths, font glyphs, ...) #1472
Conversation
8bf47eb
to
4af5cae
Compare
6e451f7
to
3b470f1
Compare
…hs, font glyphs, ...)
3b470f1
to
17edd04
Compare
…e included in some toolchains and was deprecated in C++17 anyway).
@joshtynjala Can you resolve the conflicts in ExternalInterface.cpp? It looks like you were both trying to solve the same problems but solved them in slightly different ways. |
I'd like to discourage from using |
. @joshtynjala Can you resolve the conflicts in ExternalInterface.cpp? It looks like you were both trying to solve the same problems but solved them in slightly different ways. |
In order to resolve the conflicts some maintainer needs to decide which one of those two similar functions ( |
I've opened up a another PR #1665 to clean things up so hopefully we can avoid these conversions altogether. |
Actually, it looks like there are a few other places where these conversions are still required, so might need to keep one of these functions around anyway, unless those wstrings can be avoided as well. |
Would it be possible to decide on one of these so that these unicode issues can be fixed? Maybe @nixbody's one because it is locale independent? (For reference, the commit that introduced the conflicts was 95411ac) |
I've forked and resolved the merge conflicts in a separate branch, preferring This is quite an important fix. If there are no objections, these changes can be pushed here and this could be merged? Then, once things are working finally, in future we can look at cleaning up the conversions in #1665. |
I didn't have permission to push your branch from my machine, so I redid the changes in the web editor. Let me know if I got anything wrong. |
I added a commit here to put it in sync with my branch. |
I think I'd prefer the version here, without the unsafe cast. |
You're right, looks like this is the preferred way to handle |
Casting `const char*` → `char*` is bad form, and we'd rather copy the string than do that. However, `GetGlyphIndex()` now takes a const, so neither workaround is needed.
Also, use `hxs_utf8()` for consistency.
Since all the conflicts and issues seem to be resolved here, is this something that could be merged soon? This is quite a useful fix. |
I haven't moved towards merging this because I don't know how to test it. I can tell it doesn't break the TextRendering sample on Linux, but it also doesn't fix it. But if you've gone over the changes, you can go ahead and merge it yourself. (I'm a fan of PRs being merged by whoever understands them best. Then if there's a problem it's clear who to contact.) |
I've mostly been dealing with the file dialog and file system fixes here, which I've tested and they work fine. I don't think these changes would be enough to get unicode text rendering working, I think a separate PR like #1391 is needed to deal with that. I haven't myself run into the issues with the other parts of the api this PR fixes (particularly the font related bits). However, the changes are pretty regular and simple (ensuring that necessary string conversions are performed before passing to native apis). From what I know about hxcpp and hashlink string encoding, these changes look correct to me. I'd prefer to just go ahead and merge this, but if you think it's better I could also try to create some test projects to test all these api calls, I don't know when I'll have time for this though. |
That sounds like a good level of confidence. I think you can go ahead, then. |
Adds UNICODE support for CFFI related things on HXCPP and HashLink targets.