Character Encoding

Most fundamental in dealing with Unicode characters whether in interactions with files, webpages, or in database access   is proper use of character encoding. Once the character encoding has been properly configured, programming Unicode, or international, applications becomes a transparent process. For example, in writing Unicode characters to a text file, you need to specify a Unicode encoding for the file to avoid loss of data; when reading back, you need to use the same encoding to decode what you wrote. For database applications, you need to ensure the database encoding is properly configured so that it can accept storage of Unicode data. For instance, SQL Server 2000 uses UTF-16 as its encoding, while MySQL server's encoding can be set to UTF-8 to handle international characters. Once configured properly, programming should be straight forward; Unicode characters will be handled correctly and automatically between the .NET applications and the servers.

You can directly type Vietnamese in C# or VB.NET source code using any appropriate Vietnamese input methods, save them in a Unicode (UTF-8) - Codepage 65001, and then specify the appropriate encoding when compiling them.

Program.cs:

/// <summary>
/// Program.cs
/// 
/// Source saved in Unicode (UTF-8 with or without signature) - Codepage 65001
/// </summary>
using System.Windows.Forms;

class Program
{
    static void Main(string[] args)
    {
        MessageBox.Show(null, "Thử nghiệm Tiếng Việt", "Tiếng Việt", MessageBoxButtons.OK, MessageBoxIcon.Information);
    }
}

References: