Restrict file upload to UTF-8 only with notification and stop processing (Jmix 1.5)

Hi JMIX Support,
We are using Jmix 1.5 and have a file upload feature where uploaded files are later read using Java’s UTF-8 reader (InputStreamReader with StandardCharsets.UTF_8).

Our requirement is to strictly restrict uploads to:

  • UTF-8 encoding only
  • UTF-8 without BOM
  • No UTF-7
  • No UTF-16 or any other encodings

If an uploaded file is not valid UTF-8 (without BOM), we need to:

  1. Show a user notification indicating invalid file encoding.
  2. Stop further processing and return from the upload flow.

Currently, files saved in UTF-7, UTF-16, or UTF-8 with BOM are getting uploaded successfully, which causes issues during processing.

Could you please advise:

  1. Whether Jmix 1.5 provides any built-in or recommended way to validate file encoding at upload time.
  2. The best-supported approach in Jmix 1.5 to strictly enforce UTF-8 (without BOM) and reject all other encodings.

Any guidance or best practice for this scenario would be very helpful.

Thankyou,