[file encoding] improved code & modified encoding 'select'