views:

356

answers:

2

I need to be able to allow a user to enter Vietnamese text into a text box.

I have been instructed to use VNI-Times and provided a sample word document with Vietnamese text.

When I paste the text from the sample document into the textbox it is encoded incorrectly. I have tried installing the font (VNI-Times) on both my machine and the server, and changing the encoding of my browser, all to no avail. This problem is not localized to just the browser but also to notepad.

I have found one solution so far, put a WYSIWYG editor on the page, but I am hoping to use the asp:TextBox control.

Once the text is submitted by the user it is displayed back as an image that is generated by the server, these images are also not being generated correctly.

A: 

The problem is related to copying text with the clipboard. When you copy text from a text file in non-Unicode to a textbox that assumes Unicode, there is no encoding translation and the byte string is viewed incorrectly. Would you have used a keyboard to enter the Vietnamese text directly in the input controls (asp:TextBox) all is fine.

The trick is to translate your text document to Unicode before you start copy and paste. Make sure the sample Word document is converted first and input controls will show the text correctly.

http://vietunicode.sourceforge.net/howto/unicodeconversion.html

Patrick de Kleijn
A: 

The Asian Language Pack needed to be installed on the server (Windows Server 2003).

Once the server was migrated to Windows Server 2008 installing the VNI-Times font was sufficient to solve this problem.

This has also allowed the images to be generated properly.

denny