ReadLine and special character like accent

BlitzMax Forums/BlitzMax Beginners Area/ReadLine and special character like accent

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.

This problem happens when using PRINT statement, under WINDOWS.
there's a way to solve it:

Type ANSI

	function Print(Str:String = "")
		standardiostream.writebytes(str.tocstring(),len(str))		
	End Function
	
	Function PrintLine(str:String = "")
		local LineFeed:String = chr(13) + chr(10)
		str = str + linefeed
		standardiostream.writebytes(str.tocstring(),len(str))				
	End Function
	
end type



This is a sample program:

Type ANSI

	function Print(Str:String = "")
		standardiostream.writebytes(str.tocstring(),len(str))		
	End Function
	
	Function PrintLine(str:String = "")
		local LineFeed:String = chr(13) + chr(10)
		str = str + linefeed
		standardiostream.writebytes(str.tocstring(),len(str))				
	End Function
	
end type

ansi.printline ("Print ansi characters without conversion to UTF8. áéíóú")
input


Using ANSI.Print or ANSI.PrintLine will disable the conversion of chars to UTF8, leaving the standar windows text format (usually ANSI).

If you want to keep cross-platform compatibility you can also use BLIde (an alternative BlitzMax IDE) wich supports unicode characters in its console window.