GLBasic forum

Main forum => Bug Reports => Topic started by: mull on 2013-Feb-04

Title: UCASE$ umlauts not makes it bigger
Post by: mull on 2013-Feb-04
UCASE$("aäüöpu") 

result

"AäüöPU"
Title: Re: UCASE$ umlauts not makes it bigger
Post by: MrTAToad on 2013-Feb-04
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
Title: Re: UCASE$ umlauts not makes it bigger
Post by: spacefractal on 2013-Feb-05
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.
Title: Re: UCASE$ umlauts not makes it bigger
Post by: Moru on 2013-Feb-06
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...)
Title: Re: UCASE$ umlauts not makes it bigger
Post by: MrTAToad on 2013-Feb-06
It wouldn't really help though in this case...
Title: Re: UCASE$ umlauts not makes it bigger
Post by: spacefractal on 2013-Feb-06
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.
Title: Re: UCASE$ umlauts not makes it bigger
Post by: Kitty Hello on 2013-Feb-07
yes. I'm using hte C function "toupper". I thought I fixed that. Maybe before the hdd crash back then....