1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

How can I decode a rfc2047 encoded string using javascript?

Discussão em 'Angular' iniciado por chebad, Agosto 8, 2025.

  1. chebad

    chebad Guest

    I have a service which returns e.g. jpg file. Name of it is in Content-Disposition header, but the filename is encoded in rfc2047 standard, so I have:

    filename="=?UTF-8?Q?=C4=99=C5=9B.jpg?=" => decoded to = ęś.jpg


    I found that there is in Java MimeUtility.decodeText which works nice, but I need to decode this text on client site using Angular 8. I tried to decode this text on server-site using Java and pass it to client-site and then decode it using decodeURIComponent(escape(filename)), but it doesn't work.

    Is there any equivalent of function or maybe npm dependency to decode it in Angular 8?

    Continue reading...

Compartilhe esta Página