Update cmakelists.
Implement some stuffs.

Add encoding option.
Parse the text segments.