Unanswered question

How to encode an extracted variable to UTF8

hi,

I would like to know how to convert an extracted variable in ISO-8859-1 to UTF8 ?

Value of ${myvariable} : "Batiment Tertiaire - P3 \/ Sp\u00e9cifique"

How to convert it to have : "Batiment Tertiaire - P3 / Spécifique"

Here is below a part of the response body::

"secteuroperation":
[
{
"secteuroperation": "Batiment Tertiaire - P3 \/ Sp\u00e9cifique\r"
},
{
"secteuroperation": "Batiment Tertiaire - P3 \/ BAT-EN-101\r"
},
{
"secteuroperation": "Batiment Tertiaire - P3 \/ BAT-EN-102\r"

Thanks for your help

David

EX David E.
EX David E.

EX David E.

Level
0
35 / 100
points

Answers

EX David E.
EX David E.

EX David E.

Level
0
35 / 100
points

hi,

here is the solution to put in JS.
//encode to UTF 8
var encodedValue=Packages.org.apache.commons.lang3.StringEscapeUtils.unescapeJava(Str);

Results:

var Str = "Batiment Tertiaire - P3 \/ Sp\u00e9cifique"
var encodedValue = "Batiment Tertiaire - P3 / Spécifique"

David