How to make the freewebdot.com space and database correctly display Chinese Characters

Source: Internet
Author: User
I just applied for a home page at freewebdot.com. This space supports top-level domain names, MSSQL, and large space. Make a test webpage and upload it. OK. The display is correct.
Download the asp.net forums Chinese version. I didn't want to make it into a virtual directory (shared session or other reasons) and changed it for one night. After the modification, the local display is completely correct and the file is uploaded.

Run the SQL statement in the install directory to open the page. Dizzy, how can we get all the data from the database with garbled characters?
View the database from MSSQL Web Admin provided by freewebdot.com. It was originally in English!

It's easy to know the reason. I wrote a short piece of code to change the code System for inserting the database. IO. streamReader sr = new System. IO. streamReader ("c: \ Install-Data. SQL", Encoding. getEncoding ("GB2312 "));
String s = sr. ReadToEnd ();

Sr. Close ();

System. IO. StreamWriter sw = new System. IO. StreamWriter ("c: \ Install-Data.new. SQL", false, Encoding. GetEncoding ("GB2312 "));
For (int I = 0; I <s. Length; I ++)
{
Char [] cs = Encoding. UTF8.GetChars (Encoding. UTF8.GetBytes (s. Substring (I, 1 )));
String ddd = s. Substring (I, 1 );
If (cs. Length = 1 & amp; (int) cs [0]> 768)
Sw. Write ("'+ nchar (" + (int) cs [0]). ToString () + ") + '");
}
Else
Sw. Write (s. Substring (I, 1 ));

}
Sw. Close ();

In this way, the database is inserted in UTF-8 format.

Run, test, OK

This free space provides powerful functions, allowing you to build countless sites and databases, and apply for a free space to support php5 and mysql. I wonder how long will it take to support? Because I personally feel that such space will not be supported for a long time, or I will pay for it or I will close down.
You can test it on the website I applied for: www.niih.org

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.