1: using System;2: using System.Collections.Generic;3: using System.Linq;4: using System.Text;5: using System.IO;6:7: namespace ConsoleApplication18: {9: class Program10: {11: static void Main(string[] args)12: {13: // text file to read14: string fileName = "YourFileName.extension";15: StreamReader sr = new StreamReader(fileName, Encoding.Default);16: string tempS = "";17: while (sr.EndOfStream != true)18: {19: // read a line a time20: tempS = sr.ReadLine();21: // print each line on console22: Console.Out.WriteLine(tempS);23: }24: }25: }26: }
I wanted to setup MySQL to use utf-8 on the MAMP installation on my Mac. I tried the instructions from this article: http://cameronyule.com/2008/07/configuring-mysql-to-use-utf-8/ However, I kept getting error messages that are similar to this one [ERROR] /Applications/MAMP/Library/bin/mysqld: unknown variable 'default-collation=utf8_general_ci' I did some search and realized that several variables are deprecated. Reference: http://dev.mysql.com/doc/refman/5.1/en/server-options.html Therefore, I added the following lines into /Applications/MAMP/conf/my.cnf [mysql] character-set-server=utf8 [client] character-set-server=utf8 [mysqld] character-set-server=utf8 collation-server=utf8_general_ci init-connect='SET NAMES utf8' I restarted the server and mysql run successfully with relevant variables being set correctly. In the "Variables" tab under phpMyAdmin interface (ex. http://localhost:8888/MAMP/?language=English) character set c
Comments