Search code examples
character-encodingasciimayamel

How to convert an ascii code to an actual character in Maya


I am currently developing a mel script in Maya, but am unable to print a character based on its ascii code (for example 65 should print 'A'), as the char(xx) command in other languages.

How can I achieve that ? Thanks !


Solution

  • The other way is to use a python command inside MEL script:

    $n = 65;
    print("BB" + python("chr("+$n+")") + "CC");
    

    result:

    BBACC