MaxIDE - Linux version - UTF problem

Archives Forums/Linux Discussion/MaxIDE - Linux version - UTF problem

degac(Posted 2010) [#1]
I'm trying to use the latest MaxIDE (compiled from the source code available in the account section).
In general it works well, until I try to load source code with UTF character set in it.

After some experiment I found where is the problem:
Function CacheAndLoadText$(url:Object)
	Rem
	  Local tmpResult$
	  Local tmpBytes:byte[] = LoadByteArray(url)
	  url = CreateRamStream( tmpBytes, tmpBytes.length, True, False )
	  tmpResult = LoadText(url)
	  TRamStream(url).Close()
	  Return tmpResult
	End Rem
	Return LoadText(url)
EndFunction

For some reason to accelerate the loading process it was used a 'cached ram stream'. Unfortunately the LoadByteArray (or CreateRamStream) seem to cut some informations - under Linux - with erroneus and truncated string if these contain UTF characters.

I resolved removing the caching process, but I suspect there's somewhere a bug while loading streams...

Last edited 2010

Last edited 2010


degac(Posted 2010) [#2]
Doh... my solution allow to 'load' and display the correct UFT string in MaxIDE, but when the program is compiled I get the same result: truncated string.


degac(Posted 2010) [#3]
For some strange reason I decided to run MaxIDE CE and... voitlą! It works!

I can read and run applications with UTF character in it!

Bah! Well... resolved!


SebHoll(Posted 2010) [#4]
I assume you are using the GTK+ build of MaxIDE CE?

The FLTK library itself only became UTF8 compliant very recently (in 1.3.x) and so FLTKMaxGUI still uses the older ANSI string passing routines to call C-base glue code. As such FLTKMaxGUI is not unicode compliant - I'd guess that the FLTK build of MaxIDE CE would have the same issues.


degac(Posted 2010) [#5]
My fault...

I'm using MaxIDE-CE FLTK version.
I think I've made some confusion.
Just tried to open an 'original' source file with UTF character and the strings are 'truncated'.
To resolve the problem I opened the source file with another editor (gedit), copied all the source and pasted in the MaxIDE-CE, then saved it.
Once saved - for some magic - I can reopen it without problems.

So why a copied text can be saved & loaded 'correctly'?

Why I'm using MaxIDE-CE? Because I cant' copy&paste in the 'default' MaxIDE.

So the problem is still here (but I found a sort-of-solution...)

PS: I've tried to compile via console with BMK MAKEAPP command to see if the problem could be resolved, but I got the same problem.

edit:

Btw, where can I find a 'ready & working' MaxIDE-GTK?

Last edited 2010


skidracer(Posted 2010) [#6]
There is a sticky thread in the Linux section of this site promoting the GTK version.

The thread has the unhelpful title of "Linux IDE... is it just me or...? (" so possibly not as well promoted as I thought.

With a little community involvement we can hopefully bring this issue undercontrol.

The latest version of ordinary MaxIDE for linux is here :

http://sourceforge.net/projects/maxgui/files/

with the file name maxide_linux_142_beta.tar.gz

Copy and Paste should work well, but unicode support is perhaps in a state of disrepair? UTF8 should not require any difference in calling conventions for the API so I am interested if any of the gadgets have got some limited unicode support already.

Last edited 2010


degac(Posted 2010) [#7]
Ohh! Ok thanks!
I will try the GTK version.

Just for curiosity, the problem of UTF support is in the loading phase, or in textareatext gadget?
Because once I paste&copy the problem disappears (MaxIDE-CE).... so maybe the problem is elsewhere