1

When I send special characters like â through HTTP header value, I get a different unicode character request().getHeader().

I know it's not recommended to send special characters over HTTP headers but this is a requirement for me and first I thought it's because of JVM encoding not being set to UTF-8. But even after setting I get the same issue.

I have seen someone asked a similar question:

Play Framework Unicode symbols in HTTP Header

But hasn't got an answer.

Community
  • 1
  • 1
sasankad
  • 3,543
  • 3
  • 24
  • 31

1 Answers1

1

It's not about Play or Java, it's about HTTP standard. You need to encode that characters, there is no guaranteed way to send non-ASCII character in HTTP header.

How to send non-English unicode string using HTTP header?

Illegal characters in HTTP headers

Sending non-ASCII text in Http POST header

What character encoding should I use for a HTTP header?

Even for RFC5987:

handling filename* parameters with spaces via RFC 5987 results in '+' in filenames

Community
  • 1
  • 1
Andriy Kuba
  • 8,093
  • 2
  • 29
  • 46
  • Yes i understand the HTTP standard. But as i found out Jetty server respects the file.encoding setting, even for the HTTP headers. But Netty server strictly adhere to the HTTP standard. I think only way forward for me is to encode it with base64. – sasankad Feb 23 '17 at 03:56