Attempt at Unicode.

BlitzMax Forums/BlitzMax Programming/Attempt at Unicode.

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I've been using Blitzmax for a short while now and I'm quite disappointed to see that while it claims to support UTF-8 format, it cannot read or display text encoded in this way. I understand that for the majority this is not a problem, but I (like others I've seen on this board) need to display non-roman characters such as Japanese.

I know nothing of how UTF actually works, but so far I have managed to display Japanese text using an array of individual character codes (sourced using charmap) and reading them into a string.
Is there anyway of reading these codes into the array from a text file? I know readbyte() can be used for ASCII files but it doesn't work for UTF as its values exceed 255. Any suggestions?

I read a post from a year ago where Mark said that he was going to implement this function in the next version of BMax but unfortunately I don't think it happened :(
It’s a shame because living in Japan as I do, it would be a rather useful feature.

Here is my code for anyone who wants to see...

Strict
Graphics 800,600,0

Global font:Timagefont=LoadImageFont("c:\windows\fonts\msgothic.ttc",150,SMOOTHFONT)
SetImageFont font

Global kana[]=[12371,12435,12395,12385,12399]
Global s$


For Local i=0 To kana.length-1
	s$=s$+Chr(kana[i])
Next

While Not KeyHit(KEY_ESCAPE)
	Cls
	
	SetBlend alphablend
	SetScale 1,1
	DrawText s$,20,200
	SetScale 0.15,0.15
	DrawText "[konnichiwa]",350,350

	Flip
Wend

GCCollect