struts1 icon indicating copy to clipboard operation
struts1 copied to clipboard

Character encoding in multipart/form-data

Open talp1 opened this issue 1 year ago • 4 comments

Hi Ste-gr, I've tried your 1.5.0 RC2 and it's great! Finally Struts 1 in Jakarta EE9!

Only problem I have is with character encoding of text field in "multipart/form-data" forms, it's always ISO-8859-1, regardless of page encoding (I use UTF-8 everywhere). For the moment I've bypassed the problem adding the line:

factory.setCharset(Charset.forName(request.getCharacterEncoding()));

in "org.apache.struts.upload:CommonsMultipartRequestHandler" after:

DiskFileItemFactory.Builder factory = DiskFileItemFactory.builder();

Maybe there is a cleanest solution via configuration, but I didn't find it :(

Can you tell me if it's possible to do them via configuration or if it could be useful to add my modification (perhaps improved) in the next release?

Thanks

Ale

talp1 avatar Jul 29 '24 16:07 talp1

Hi @talp1,

thank you for your report. I'll have a look at it.

Greetings Stefan

ste-gr avatar Aug 04 '24 18:08 ste-gr

@ste-gr We were experiencing the same problem with our application and did basically the same patch. It worked fine.

nyrygyk avatar Aug 16 '24 07:08 nyrygyk

Hi @talp1 and @nyrygyk,

thank you for the hinds. I will try to correct this by the end of this week (01/09/2024).

Greetings Stefan

ste-gr avatar Aug 26 '24 23:08 ste-gr

Hi Stefan, thank you for your effort to this great project, I look forward to your changes.

Ale

talp1 avatar Aug 27 '24 05:08 talp1