[Gtk-sharp-list] TextBuffer character encoding

Thiago Milczarek Sayão sayao@brturbo.com
Sat, 21 Feb 2004 15:05:08 -0300


--=-qGhxpWk3a4OekmiRQjbC
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Take a look at this simple example, its not displaying some characters
corretly. Not sure if its a bug or not. Do i need to do some string
conversion ?

compile with mcs TestBuffer.cs -o TestBuffer.exe /r:gtk-sharp.dll

Thanks,
Thiago.

--=-qGhxpWk3a4OekmiRQjbC
Content-Disposition: attachment; filename=TestBuffer.cs
Content-Type: text/x-csharp; name=TestBuffer.cs; charset=UTF-8
Content-Transfer-Encoding: 8bit

using System;
using Gtk;

class TestBuffer
{
	TextView tv;
	
	static void Main ()
	{
		new TestBuffer ();
	}
	
	TestBuffer ()
	{
		Application.Init ();
		Gtk.Window win = new Gtk.Window ("TextView Test");
		win.SetDefaultSize (400, 300);
		win.DeleteEvent += new DeleteEventHandler (OnWinDelete);
		
		VBox vbox = new VBox (false, 0);
		win.Add (vbox);

		TextBuffer buf = new TextBuffer (null);
		tv = new TextView ();
		tv.Buffer = buf;

		buf.Insert (buf.EndIter, "This is a string that should not look like this: ãóíú͊ΩЯӬ✄✞«®¢©ʬ");
		vbox.PackStart (tv, true, true, 0);

		win.ShowAll ();
		Application.Run ();
	}
	
	void OnWinDelete (object o, DeleteEventArgs args)
	{
		Application.Quit ();
	}
}

--=-qGhxpWk3a4OekmiRQjbC--