BYVoid/OpenCC — pull request #13 by maxiaojun (2012-11-16 05:14:39+00:00)
Title: Fix of Issue 26 on Google Code

http://code.google.com/p/opencc/issues/detail?id=26

I added a helper function skip_utf8_bom() to util.c/util.h. It will pop 3 bytes from input stream if there is exact UTF-8 BOM [1] and it will leave input stream logically unchanged otherwise.

I call skip_utf8_bom() whenever OpenCC opens a plain text file. There are three places, OpenCC input file, OpenCC config file and plain text dictionary file.

1. http://en.wikipedia.org/wiki/Byte_order_mark#Representations_of_byte_order_marks_by_encoding