Unicode Apptitle

BlitzMax Forums/BlitzMax Programming/Unicode Apptitle

tschaef1(Posted 2009) [#1]
Hi!

I have a problem to give my game window a russian AppTitle.

I did it in this way:

AppTitle="головоломки"

But all I get is some ASCII - trash - code.

This happens also when I change my computers language to Russian.

So, my question is: Has anybody an idea how to write cyrillic (unicode?) letters in the windows title? Thanks!


tschaef1(Posted 2009) [#2]
Ok :) Now I see my topic and there is also the same ASCII - trash visible in the text as in my AppTitle. Sorry! But I don't know how to avoid this.


Brucey(Posted 2009) [#3]
Interestingly, it works fine running under Darwine on the Mac (win32 cross-compile) using BlitzMax 1.34

What version of BlitzMax are you using? At least 1.33 I would say, for this to work properly.

I'll check in Windows too in a moment.


Brucey(Posted 2009) [#4]
This works on my 1.33 Windows build (in Parallels) :
SuperStrict

Framework brl.glmax2d

Local chars:Int[] = [1047, 1072, 1075, 1086, 1083, 1086, 1074, 1082, 1072, 32, 1087, 1088, 1080, 1083, 1086, 1078, 1077, 1085, 1080, 1103]

AppTitle = StringFromIntArray(chars)

Graphics 640, 480, 0

While Not KeyDown(key_escape)

Cls
Flip

Wend

Function StringFromIntArray:String(array:Int[])
	Local shorts:Short[] = New Short[array.length]
	For Local i:Int = 0 Until array.length
		shorts[i] = array[i]
	Next
	Return String.FromShorts(shorts, array.length)
End Function

Since I can't display the proper text on the forums, I had to write a little hack so I could post a runnable example :-p

It should say something like "Application title" on the window. (in cyrillic, obviously).


tschaef1(Posted 2009) [#5]
Oh, I'm still using version 1.28 ...
I will install an update as soon as possible and try again!


tschaef1(Posted 2009) [#6]
It works very well with the new version 1.34

Thanks Brucey!!!