No File/Foldername Unicode support at all?

BlitzMax Forums/BlitzMax Programming/No File/Foldername Unicode support at all?

No Not yet. MultiJuke was ported to Linux, so I might hold it cross platform. But I guess I got a workaround, but I wait for the report on the work from the email.

It seen the Russia Windows actually used ascii table on filename with this charset used: http://www.ascii.ca/cp1251.htm

Hence I have copy paste from the page (not source code) over to notepad (which seen support unicode in Vista) and save it as UTF-8.

Then I used the table to convert the ascii filenames to unicode, so it show the currect codes:

Type TCodebase
	Field Alphabet$
	Field Char:String[]=New String[256]
	Global List:TList=New TList
	Global Count=0
	Global current:String[]=New String[256]
	Global currentAlphabet$
	Function Init()
		Local files$[]
		Local Path$=CurrentDir()+"/alphabet/"
		files=LoadDir(Path$, True)
		For Local t$ = EachIn files
			Local in:TTextStream=TextFileReader.CreateStream(path$+T$)
			If in<>Null
				Local s:TCodebase = New TCodebase
				While Eof(In)=0
					Local TXT$=ReadLine(in)
					If Left$(TXT$,2).toInt()>0
						Local Number=Left$(TXT$,3).toInt()
						TXT$=Right$(TXT$,Len(TXT$)-6)
						If Left$(TXT$,1)=" " Then TXT$=Right$(TXT$,Len(TXT$)-1)
						TXT$=Trim$(TXT$)
						Local Letter$=Left$(TXT$,2)
						Letter$=Trim$(Letter$)
						If Number>32
							s.Char$[Number]=Letter$
						Else
							s.Char$[Number]=" "
						EndIf
					EndIf
				EndWhile
				s.Alphabet$=StripAll$(t$)
				Count:+1
				List.AddLast(s)
			EndIf
		Next
	EndFunction

	Function Set:Int(Alphabet$)
		currentAlphabet$=""
		current:String=New String[256]
		For Local s:TCodebase = EachIn List
			If Alphabet$=s.Alphabet$ 
				For Local i=0 To 255
					current[i]=s.Char[i]
				Next
				currentAlphabet$=s.Alphabet$
				Return 1
			EndIf
		Next
	EndFunction

	Function Name$(Number)
		If Number=>CountList(List) Then Return ""
		Return TCodebase(List.ValueAtIndex(Number)).Alphabet$
	EndFunction

	Function Translate$(txt$)
		Local Result$=""
		For Local i=1 To Len(Txt$)
			Local char:Int=Asc(Mid$(Txt$, i,1))
			Result$=Result$+Current[char]
		Next
		Return Result$
	EndFunction
EndType


I hope that one works.

For hiscore and general translating, I recommered to UTF-8 based text files and no not use unicode filename (this make sure it work on all OS when moving). There are a code on this forum to read them correctly (or use readtext() and savetext()).