UCASE$ umlauts not makes it bigger

Previous topic - Next topic

mull

UCASE$("aäüöpu") 

result

"AäüöPU"
AMD Phenom II x4 955 Proc. 3.2 GHZ,  4GB Ram
Windows 7 64bit Ultima
NVIDIA GeForce GTX 460
Leistungsindex 5,7

MrTAToad

#1
Standard C/C++ locale functions wont always work correctly anyway either for non-English languages unfortunately.  To work correctly Gernot would have to use something like ICU : http://icu-project.org/apiref/icu4c/index.html

spacefractal

Or write a function to that, eventuelly with inline. It's also not work with Danish, but it's pretty normal it's happens in most languages.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Moru

In all programming courses I have been to, one of the assignments has been to fix the upper/lower-case functions to include the swedish characters too :-). Only the ASCII characters are supported everywhere. Most of the time you can just check the range of the character code is between 0xC0 and 0xDD. This makes it upper case. If you want them in lower case you do
Code (glbasic) Select
lower_case = OR(charcode%, 0x20)

Code (glbasic) Select
upper_case = AND(charcode%, 0xDF)

This has to be done on the whole string so will slow down a little bit. On the other hand upper/lower case is nothing you should need to do every frame. Do it once and save the results instead.

You can see it as bit number 5 sets upper/lower case. This of course only works in certain character sets. Look at the font. If you have 16x16 characters and the lower-case characters are exactly two rows under the upper-case characters, it should work.

(not totally sure about the commands, no GLBasic close by...)

MrTAToad

It wouldn't really help though in this case...

spacefractal

Unicode would property never been supported in glbasic, since its use a bitmap font system, not true type system and strings is 8 bit.

Still you can use mid, for and dim functions to doing by your self, so don't except this to been (quickly) fixed.

Should been pretty easy to do that.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Kitty Hello

yes. I'm using hte C function "toupper". I thought I fixed that. Maybe before the hdd crash back then....