Skip to content

encodeparm

Since18.0

string  encodeparm(string str)

Houdini parameter names are only allowed to contain letters, numbers, hash characters (for multiparms), and underscores, and must not begin with a number. This function takes any string, and encodes it into a string that obeys these restrictions. The original string can be recovered using the decodeparm function. A string that already obeys the rules is returned unmodified.

One exception to this rule is that a string starting with xn__ will be encoded even if it is already a valid parameter name. This is because xn__ is the prefix used to identify an encoded string. In this case, an additional xn__ prefix will be added. This means a string can be encoded any number of times, then decoded the same number of times to always return to the original string, regardless of its contents.