Encode special characters to STEP format (ISO-10303-21)

Viewed 23

I receive a string as kanjis and I'd like to encode it, although, I am having some issues here, since the format that I want is in STEP (more known as ISO-10303-21).

This is the string decoded: 外 路 道
This is the string encoded: \X2\657757305916\X0\ \X2\90538DEF\X0\ \X2\8ECA9053\X0\

I've tried to use string.charCodeAt() but I didn't get the expected result...

      public static encodeString(ifcString: string) {
        return ifcString.charCodeAt(0);
      }

      console.log(this.encodeString('外 路 道'))

This is the result that I get: 22806.

Could someone help me here? Thank you..

0 Answers
Related