[Gtk-sharp-list] Invalid UTF8 string

Tiago Lima tiago.lima@vianw.pt
Sun, 22 Feb 2004 12:19:30 +0000


Here is an example with the warning:

	using Gtk;
	using GtkSharp;
=09
	using Pango;
=09
	// COMPILE: mcs -r:gtk-sharp.dll -r:glib-sharp.dll -r:gdk-sharp.dll=20
	-r:pango-sharp.dll -out:UTF8Warning.exe UTF8Warning.cs
=09
	public class UTF8Warning
	{=20
		static void Main()
		{
			new UTF8Warning();
		}
	=09
		protected Pango.Layout _pangoLayout;
	=09
		static UTF8Warning()
		{
			Application.Init();
		}
		public UTF8Warning()
		{
			Window win =3D new Window("UTF8 Testing");
			win.DeleteEvent +=3D new DeleteEventHandler(OnWinDelete);
			win.SetDefaultSize(600,400);
		=09
			_pangoLayout =3D win.CreatePangoLayout("");
			_pangoLayout.SetText("=E7");
		=09
			win.ShowAll();
		=09
			Application.Run();
		}
		protected void OnWinDelete (object obj, DeleteEventArgs args)
		{
			Application.Quit ();
		}
	}
=09
On Sunday 22 February 2004 12:14, Tiago Lima wrote:
> Hi,
>
> I think the code:
>
> 	Pango.Layout pangoLayout =3D ...
> 	pangoLayout.SetText("=E7"); // or any other with accents...
>
> gives a warning:
>
> ** (<unknown>:1868): WARNING **: Invalid UTF8 string passed to
> pango_layout_set_text()
>
> Am I missing something, like setting some property in the layout or so?
>
> Thanks in advance,
> 	Tiago Lima
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list