Category: IT Reviews

The default collation in mysql is not always utf-8. Because the company of mysql localed in Sweden, so the encoding or collation is latin1_swedish_ci by default. You should change this feature after you installed the mysql DB server. But If you have  operated your web site for a long time, then you want to update your site for reasons. There are lots of data existed in Mysql in the encoding latin or other not UTF8. How to change the encoding or Collation to UTF-8 ?

Just download this tool to change the collation of tables or data to UTF8:

http://www.phoca.cz/phoca-changing-collation/

The Phoca Changing collation tool changes the database collation of database, tables and columns. And it is easy to use.

机器翻译无法做到完美甚至可用的程度。

机器智能达到人类智能还很遥远。

  1. import java.util.Properties;
  2.  
  3. ...
  4.  static String profilepath="webapps/ROOT/WEB-INF/server.properties";
  5.      private static Properties props = new Properties();
  6.  
  7.         static {
  8.              try {
  9.                 props.load(new FileInputStream(profilepath));
  10.             } catch (FileNotFoundException e) {
  11.                 e.printStackTrace();
  12.             } catch (IOException e) {       
  13.                 e.printStackTrace();
  14.             }
  15.         }
  16.           
  17.         public static String getKeyValue(String key) {
  18.             return props.getProperty(key);
  19.         }           
  20.      //the directory that is used to store lucene index
  21.   public final String indexDir = getKeyValue("INDEX_ROOT");