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

UTF-8 support for ordinal characters #2907

Closed
DorpsGek opened this issue May 20, 2009 · 2 comments
Closed

UTF-8 support for ordinal characters #2907

DorpsGek opened this issue May 20, 2009 · 2 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

planetmaker opened the ticket and wrote:

I am trying to add a portuguese translation for a newgrf. There's one character, though, which obviously is still interpreted differently than intended: the ordinal symbol 1ªG (the one in the middle, corresponding to st, nd, rd, th in English, list 1st, 2nd, 3rd)

Currently the ordinal symbol is interpreted as the downward arrow as found in the scroll bars of OpenTTD. Attached is the language NFO file (for easy access to the strings), the complete nfo file and the compiled newgrf. Choose Portuguese language and look in the purchase list within train depots.

Tested with trunk r16254

Excerpt from IRC chat with petern (10:41h CEST, 20th May 2009):
no gui characters overlap standard characters
or at least, shouldn't do, heh
,...{ 0x00AA, CLRA }, // Feminine ordinal indicator / Down arrow
CLRA means it is cleared from the available characters
meh... :S
so i have no idea how you're getting it :p
,...,...,...case 0xAA: d += Utf8Encode(d, SCC_DOWNARROW); break;
oic
hmm
hm... which source file is that found in?
newgrf_text.cpp
hmm, no, that's wrong
planetmaker, congrats, you found a bug
r11622
-Codechange: support the unicode version of the 'control' characters.

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/2907
@DorpsGek
Copy link
Member Author

peter1138 wrote:

Relevant part of the NFO spec;

"Everything in that string is then assumed to be in UTF-8 encoding, with the following exception: if characters appear that are not valid UTF-8 sequences, they are assumed to be one of the above control codes. This way, it is still possible to write, e.g. "ÞCapacity: " 87 "litres", without encoding the 87 in UTF-8 (which would instead refer to a character installed at codepoint U+0087).

In addition, this allows using the non-Unicode characters 9E, 9F, A0, AA, AC, AD, AF, B4..B9, BC and BD from the above list, which when encoded with UTF-8 would refer to their respective Unicode characters instead. To use the TTD characters, simply do not encode them using UTF-8 but enter them directly as bytes. This causes them to be an invalid UTF-8 sequence and allows TTDPatch to use the correct symbol from TTD's fonts."


This comment was imported from FlySpray: https://bugs.openttd.org/task/2907#comment6096

@DorpsGek
Copy link
Member Author

peter1138 closed the ticket.

Reason for closing: Fixed

Fixed in r16374


This comment was imported from FlySpray: https://bugs.openttd.org/task/2907

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant