0

I have an issue fetching from my Node.js application settings from Azure - characters are not shown same from Azure. For example using process.env.TEMPORARY_WARNING it results in: "Vissa anv„ndare upplever problem just nu." - but on Azure looks like below.

"Å" becomes "†",
"Ä" becomes "„",
"ö" becomes "”",

{
    "name": "TEMPORARY_WARNING",
    "value": "Vissa användare upplever problem just nu."
    "slotSetting": true
}

I think I somehow need to set charset to UTF-8, but cannot find any solution to do so.

Sajgon
  • 3
  • 2

1 Answers1

0

it's problem with process.env , as a workaround you can useiconv-lite to encode your settings and decode them when you need ,

var iconv = require('iconv-lite');

var buf = iconv.encode(process.env.MYTEST, 'win1252');
var result = iconv.decode(buf, 'ibm437');

Source : Why Azure appsettings encoding bring me wrong chars?

Houssem
  • 1,042
  • 7
  • 16