diff --git a/flows/routers/cases/tests_test.go b/flows/routers/cases/tests_test.go index 16c14d6d0..37d4dd4c8 100644 --- a/flows/routers/cases/tests_test.go +++ b/flows/routers/cases/tests_test.go @@ -173,7 +173,8 @@ var testTests = []struct { {"has_number", []types.XValue{xs("hi.51")}, result(xn("51"))}, {"has_number", []types.XValue{xs("hi .51")}, result(xn("0.51"))}, {"has_number", []types.XValue{xs(".51")}, result(xn("0.51"))}, - {"has_number", []types.XValue{xs("١٢٣٤")}, result(xn("1234"))}, + {"has_number", []types.XValue{xs("١٢٣٤")}, result(xn("1234"))}, // Arabic + {"has_number", []types.XValue{xs("۱۲۳۴")}, result(xn("1234"))}, // Eastern Arabic {"has_number", []types.XValue{xs("٠.٥")}, result(xn("0.5"))}, {"has_number", []types.XValue{xs("nothing here")}, falseResult}, {"has_number", []types.XValue{xs("lOO")}, falseResult}, // no longer do substitutions diff --git a/flows/routers/cases/utils.go b/flows/routers/cases/utils.go index 1449196c4..9d868004c 100644 --- a/flows/routers/cases/utils.go +++ b/flows/routers/cases/utils.go @@ -9,7 +9,7 @@ import ( ) var altNumerals = map[rune]rune{ - // Eastern Arabic + // Arabic-Indic digits '٠': '0', '١': '1', '٢': '2', @@ -21,6 +21,18 @@ var altNumerals = map[rune]rune{ '٨': '8', '٩': '9', + // Eastern Arabic-Indic digits (Persian and Urdu) + '۰': '0', + '۱': '1', + '۲': '2', + '۳': '3', + '۴': '4', + '۵': '5', + '۶': '6', + '۷': '7', + '۸': '8', + '۹': '9', + // Bengali '০': '0', '১': '1',