Skip to content

Instantly share code, notes, and snippets.

@xbee
xbee / gbk_to_utf8_transcoder.py
Last active August 29, 2015 14:27
A small Python script that converts a file encoded in Code Page 936 (aka GBK) to UTF-8.
#! /usr/bin/env python3.4
# Code Page 936 (GBK) to UTF-8 Transcoder
# Author: Kristian Tang (@Krisiouz)
# A small script that converts a file encoded in Code Page 936 (GBK) to UTF-8.
def gbk_to_utf8(input_file, output_file):
# Load Files
input_file_opened = open(input_file, 'r', encoding='cp936')
input_file_read = input_file_opened.read()
@xbee
xbee / gist:9224894
Created February 26, 2014 06:55
erlang 常见错误提示
7> math3:area({rect, 2, 3}).
** exception error: no function clause matching math3:area({rect,2,3}) (math3.erl, line 4)
8> math3:area({rectangle, 2, 3}).
6
9> c(math3).
math3.beam: Module name 'math2' does not match file name 'math3'
error
11> A =5.
** exception error: no match of right hand side value 5