Support double byte character set

In japanese, many people are editing utf-8 file with cp932 encoding on windows.
(There is some people using non-utf-8 encoding on unix also)
And line2byte depend on fileencoding(i.e. utf-8). So completion doesn't work.
Below is a patch. Please check and include.