-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Accents in open/save dialogs are displayed wrongly #3178
Comments
I can't reproduce this on Windows, so possible OSX / Posix only? |
AFAIK osx saves the accents in the file system as Unicode combining characters. So it's first an e character and then a combining ` character for example. We probably need to canonicalize the filenames first before displaying them. Or alternatively support Unicode properly, probably not possible with the bitmap fonts. |
@HaasJona no, it works fine in Windows with accents - the problem is the conversion from the OS encoding to UTF-8, in |
I know it works fine in Windows with accents. But that is because windows doesn't use combining characters. In Windows the é is a single character, on osx, it is 2 characters. |
@HaasJona The problem lies in posix.c:platform_enumerate_files_begin... the code is not correctly converting the string from whatever the OS stores it as to UTF-8. Windows is fine because I correctly convert it from widechar to UTF-8. |
If it works in Linux, then OSX needs some extra code to convert to UTF-8 just like Windows has. This has to happen in the |
You are certainly correct, but what I'm saying is that I believe that OSX already returns the file name in UTF-8, just that its "weird" UTF-8, because for example ç isn't encoded as 0xC48D (which would be the usual UTF-8 encoding as expected by the game), but as 0x63CC8C which would be a normal c (0x63) and a combining caron (0xCC8C). But both are technically correct UTF-8 representation, It's probably just an issue with the game that there is no sprite for the combining character (and a generally missing functionality of overlaying multiple sprites for a single character), so we either need to handle all UTF-8 correctly or we need to "recombine" (normalize) the file names the OS give us, by "translating" 0x63CC8C back to 0xC48D. There are probably library functions for that, but I only know the API for Java and not C/C++. |
The only function that should be changed is |
I really doubt that the current code bitmap is able to draw combining characters correctly. |
@HaasJona It will draw correctly because the filename will have been converted to the correct UTF-8 encoding the game understands where an é will be one single codepoint that maps to a sprite. |
@IntelOrca OK. What I mean is that the representation as 2 codepoints is technically just as correct as the normal 1 codepoint representation. You may have seen text like ̷ͮt߳̀̽͘ͅh̸͓͓͉̦́͌̑᷄҆߱í̱̝̻̉͒͡s͚̓̀ which is just normal UTF-8 with random combining characters, too. So there is nothing wrong or incorrect about that. Normalizing the file names OSX gives us in |
This needs the same treatment as loading the RCT2 files for a folder with accents, whcih @rwjuk fixed. |
@rwjuk I haven't yet been able to check whether this bug has been solved by your earlier work or not. If it's already fixed then this obviously can be closed. |
I will have a look - if not, it'll almost certainly just be adding in appropriate calls to the precomposition function for macOS. |
…when displayed * Precompose file name strings on macOS to prevent mojibake when displayed * Ensure decomp-to-precomp string replacement is handled safely * Add macOS non-ASCII handling to changelog; add comments to relevant block * Fix #ifdef alignment * Fix comment alignment
- Feature: [#1399 (partial), #5177] Add window that displays any missing/corrupt objects when loading a park - Feature: [#5056] Add cheat to own all land. - Feature: [#5133] Add option to display guest expenditure (as seen in RCTC). - Feature: [#5196] Add cheat to disable ride ageing. - Feature: [#5504] Group vehicles into ride groups - Feature: [#5576] Add a persistent 'display real names of guests' setting. - Feature: [#5611] Add support for Android - Feature: [#5706] Add support for OpenBSD - Feature: OpenRCT2 now starts up on the display it was last shown on. - Feature: Park entrance fee can now be set to amounts up to £200. - Improved: Construction rights can now be placed on park entrances. - Improved: Mouse can now be dragged to select scenery when saving track designs - Fix: [#259] Money making glitch involving swamps (original bug) - Fix: [#441] Construction rights over entrance path erased (original bug) - Fix: [#578] Ride ghosts show up in ride list during construction (original bug) - Fix: [#597] 'Finish 5 roller coasters' goal not properly checked (original bug) - Fix: [#667] Incorrect banner limit calculation (original bug) - Fix: [#739] Crocodile Ride (Log Flume) never allows more than five boats (original bug) - Fix: [#837] Can't move windows on title screen to where the toolbar would be (original bug) - Fix: [#1705] Time Twister's Medieval entrance has incorrect scrolling (original bug) - Fix: [#3178, #5456] Paths with non-ASCII characters not handled properly on macOS. - Fix: [#3346] Crash when extra long train breaks down at the back - Fix: [#3479] Building in pause mode creates too many floating numbers, crashing the game - Fix: [#3565] Multiplayer server crash - Fix: [#3681] Steel Twister rollercoaster always shows all track designs - Fix: [#3846, #5749] Crash when testing coaster with a diagonal lift in block brake mode - Fix: [#4054] Sorting rides by track type: Misleading research messages - Fix: [#4055] Sort rides by track type: Sorting rule is not really clear (inconsistent?) - Fix: [#4512] Invisible map edge tiles corrupted - Fix: [#5009] Ride rating calculations can overflow - Fix: [#5253] RCT1 park value conversion factor too high - Fix: [#5400] New Ride window does not focus properly on newly invented ride. - Fix: [#5489] Sprite index crash for car view on car ride. - Fix: [#5730] Unable to uncheck 'No money' in the Scenario Editor. - Fix: [#5750] Game freezes when ride queue linked list is corrupted. - Fix: [#5819] Vertical multi-dimension coaster tunnels drawn incorrectly - Fix: Non-invented vehicles can be used via track designs in select-by-track-type mode. - Fix: Track components added by OpenRCT2 are now usable in older scenarios. - Technical: [#5047] Add ride ratings tests - Technical: [#5458] Begin offering headless build with reduced compile- and run-time dependencies - Technical: [#5755] Title sequence wait periods use milliseconds - Technical: Fix many desync sources
…ojibake when displayed * Precompose file name strings on macOS to prevent mojibake when displayed * Ensure decomp-to-precomp string replacement is handled safely * Add macOS non-ASCII handling to changelog; add comments to relevant block * Fix #ifdef alignment * Fix comment alignment
OS: MacOS 10.11.4
Version: 0.0.4
When saving or loading a game, if a file has accents in its name, it will be shown as the unaccentuated letter followed with a ?. However on the disk, accents are fine.
For example, "é" becomes "e?", "à" becomes "a?".
Screenshots / Video:
![capture d ecran 2016-03-26 a 14 50 47](https://cloud.githubusercontent.com/assets/18069013/14060356/6807d69a-f362-11e5-880a-96a54bd1df1e.png)
« Frontie?res Forestie?res » should read as « Frontières Forestières ».
It's fine in the Finder.
The text was updated successfully, but these errors were encountered: