title: Change encoding of uploaded MultipartFile in Spring Boot
body: <p>I have an endpoint which receives a MultipartFile.</p>
  
  <pre><code>Resource upload(@PathVariable Integer id, @RequestParam MultipartFile file) throws IOException {
  </code></pre>
  
  <p>This file usually is a <code>.csv</code> that I need to process every line and save the data.</p>
  
  <p>But recently an user send a file with <code>UTF-16 LE</code> encoding and this adds a lot of strange characters in the data.</p>
  
  <p>I'd like to receive the file with any encoding and always force to my acceptable encoding, for example, <code>UTF-8</code>, before process the file.</p>
  
  <p>How can I do this?</p>