Resource resource = (Resource) new ClassPathResource("/register.txt"); EncodedResource enc = new EncodedResource(resource,"UTF-8"); String content = ""; try{ content = FileCopyUtils.copyToString(enc.getReader()); }catch(Exception e){ e.printStackTrace(); } return content;