UTF-8 character support in Rego policies/rules

Viewed 414

I am a newbie on OPA and Rego, evaluating OPA for one of my applications. My application support localization and multiple languages. One of them is Simple Chinese. When I tried to evaluate a simple Rego rule consisting of some simple Chinese characters, I have received an error.

Error:

 rego_parse_error: illegal token input.city == '米尔福德'

Sample rule:

city  := {"city" : input.city}{
      input.city == '米尔福德'
  }

Does Rego support UTF-8 character set, and can rules be written on values containing special characters like above?

1 Answers

Single quotes does not denote a string in Rego. Using double quotes your rule works as expected.

Related