AnsweredAssumed Answered

String Length Problem

Question asked by DarrellFlenniken9941 on Feb 28, 2017
Latest reply on Mar 1, 2017 by DarrellFlenniken9941

I'm having problem getting the length of  string that contains ISO-8859-1 characters in Boomi

 

Using stand-alone Javascript --

 

var n = "ASCII and ISO-8859-1 Characters: XXXXXXXXXXXX'¾)}˺[°Ïz¬*%^/8QÐc6o¶©ñ!ÅPÒáµ
HUÆÊWýGç
Fðg½ÝXtÁÀy0ê>{b¯ÍÑÂ$5Sø¼]õ몷ÎûK÷ÛÓßqósè9fBü#òvÙ£3híòæVöwãÖ¹O7
¥ØôîeZ±¨<úÚE;+¡u~`
iNIL¤MÕâmÈÔx§A×ù³n|ì_ÜRd,&¸Cp:ÄÇÿéþ®¦lTÌ=äkàj?¢ïa\Þ»(å1J«-42@¿´DÉY.r"j?¢ïa\Þ»(å1J«-42@¿´DÉY.r"XXXXXXXXXXXXXXXXXXXXXX"

 

writeln(n.length); returns 316 which is correct

 

Using the  length property in a Boomi Javascript  or with the Groovy .length() method returns 285.

 

How can I get the correct length?

Outcomes