code: public static String getCharset(@NotNull String mime, String fallback) {
          // TODO: exceptions json and which other should also be marked as text
          if (mime.startsWith("text")) {
              return defaultContentEncoding;
          }
  
          return fallback;
      }
docs: Gets the default charset for a file.
  for now all mime types that start with text returns UTF-8 otherwise the fallback.
  
  @param mime     the mime type to query
  @param fallback if not found returns fallback
  @return charset string