Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

86
Visualizações
JSON passes newline as %5C instead of \n

I have a cfml struct, like below:

<cfscript>
jsonThing=structnew()
            jsonThing.header = "sometext\nsome more\none more line";            
            jsonThing.phone = "(123) 456-6789";
            jsonThing.city="Nukus";
            jsonThing.state="Coolest one";
            jsonThing.zipcode="74000-6000";         
            jsonThing.descript=#description#; //array;
            jsonThing.descript2=#description2#; //array;
</cfscript>

A custom protocol cstprt has been created and deployed on the client computers (PC, Windows 10).
JSON is sent to clients:

function cstprt() {          
             window.location.href='cstprt:/<cfoutput>#SerializeJSON(jsonThing)#</cfoutput>';}
cstprt();

Then a desktop app receives this JSON and prints out it on a receipt printer.
It was working fine until Firefox update v.95 came up. Everything else works still fine, except \n now comes as %5C on the receiving end.
I am not sure if this because of the Firefox update or some Windows update.
Firefox a must browser for us.
Question is how to make JSON to pass newline as \n again? Please share your expertise.
What I have done so far:

  • Internet search. Lot of \n issues/solutions, but not non of them applicable to my case.
  • Confirmed that JSON was passed newline as \n before and now it %5C.
  • Tried making \\n as online research suggested.

Thank you for reading. I appreciate your time!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda