[Mono-bugs] [Bug 334409] Keyboard: latin chr doesn't work in a winform textbox

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Oct 17 17:50:46 EDT 2007


https://bugzilla.novell.com/show_bug.cgi?id=334409#c7





--- Comment #7 from Eric Petit <surfzoid2002 at yahoo.fr>  2007-10-17 15:50:45 MST ---
true, it's a really problem.
For me i have the choice in my regional param to change language and keybord
layout, for this i have the mcc of mdv 2008, under suse there is something like
mcc
In last solution it's possible to modify the /etc/X11R6/xorg.conf file by the
hand
or perhap's in first time you make a copy/paste of "Mémoire du téléphone"
but it's not objective.
More simple, in mono code source you made all in UTF8 and then detect cultur of
the environment to translat System.Text.Encoding..utf8, or you directly work
with "System.Text.Encoding.defaut" propertie of encoding
like this 
using System.Windows.Forms;
using System;

public partial class Form1 : Form
    {
                    /// <summary>
        /// Point d'entrée principal de l'application.
        /// </summary>
        //[STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
         //   Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }

        public Form1()
        {
                        TextBox txtlatin = new TextBox();
                        txtlatin.Text = "Mémoire téléphone";
                        this.Controls.Add(txtlatin);
                string XmlData = txtlatin.Text ;
                            try
            {
                    MessageBox.Show("before" + XmlData);
                byte[] UTF8Bytes =
System.Text.Encoding.Default.GetBytes(XmlData.ToCharArray());
                byte[] DefBytes =
System.Text.Encoding.Convert(System.Text.Encoding.UTF8,
System.Text.Encoding.Default, UTF8Bytes);
                XmlData = System.Text.Encoding.Default.GetString(DefBytes);
                    MessageBox.Show("After" + XmlData);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message + Environment.NewLine +
ex.StackTrace);
                throw;
            }
        } 
        } 


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list