add code page detection code