How to make a Unicode identifier valid?

Hi experts,
USD 24.03 supports Unicode identifiers, but the C++ API function TfMakeValidIdentifier still keeps the old behavior.
Is there any method to make a Unicode identifier valid?

Thanks.

1 Like

see Bi-Directional Transcoding of Invalid Identifiers by miguelh-nvidia · Pull Request #37 · PixarAnimationStudios/OpenUSD-proposals · GitHub for a proposal on this :pray:t3:

3 Likes

If you want a functional equivalent of TfMakeValidIdentifier, you should be able to use the unicode utilities provided in tf to convert the string to code points, replace the non-identifier code points with _, and then convert the code points back into a string.

We didn’t update TfMakeValidIdentifier / TfIsValidIdentifier since they have potential usages outside of SdfPath validation. We were also hesitant about making tf dependent on what sdf considers to be a valid identifier.

2 Likes