added encoding option to Adapter#new