Affects: 5.3.4

After upgrading to Spring boot v2.4.3 and Spring v5.3.4. We noticed that when uploading files via Webflux, the filenames containing accentuated characters (i.e é,à...) end up as a jumbled mess in the destination.

I believe this is due to the fact that Spring now uses DefaultPartHttpMessageReader that uses ISO_8859_1 (default encoding for multipart/from-data) to read the Part instead of SynchronossPartHttpMessageReader that defaulted to UTF-8 in case no character encoding was specified .

I have added nio-multipart-parser as a dependency and configured my app as follows :

public void configureHttpMessageCodecs(ServerCodecConfigurer configurer) { SynchronossPartHttpMessageReader partReader = new SynchronossPartHttpMessageReader(); MultipartHttpMessageReader multiPartReader = new MultipartHttpMessageReader(partReader); configurer.defaultCodecs().multipartReader(multiPartReader); configurer.defaultCodecs().jackson2JsonEncoder(new Jackson2JsonEncoder(objectMapper)); configurer.defaultCodecs().maxInMemorySize(8 * 1024 * 1024); }

With this configuration the UTF-8 characters are correctly read once again. But we really want to benefit from the new Streaming Mode that comes with DefaultPartHttpMessageReader.

Can DefaultPartHttpMessageReader offer the possibility of overriding the default character encoding ?

I thank you in advance for your reply.

Comment From: poutsma

After bringing myself up to date with the latest specs (specifically RFC 7578), I have changed the default to UTF-8 (but also made it configurable).

Comment From: saad14092

@poutsma Well that was quick! Thank you.