Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-17355

LOCALE anomaly for REGEXREPLACE and POSIX character classes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Accepted
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Compatibility:
      Major

      Description

      I assume that we intended to use the POSIX rules for character classes for STRING data. The REGEXREPLACE function for:

      fn_KeepPrintableChars(STRING s) := REGEXREPLACE('[^[:graph:]]', s, '');
      test := '\tDan­Càmpér';
      res := fn_KeepPrintableChars(test);
      OUTPUT(test, NAMED('Test'));
      OUTPUT(res, NAMED('res'));
      OUTPUT((>DATA<)test, NAMED('test_hex'));
      OUTPUT((>DATA<)res, NAMED('res_hex'));
      

      is acting as if the only graphic characters were the US-ASCII characters. The Perl documentation says that this is the behavior if Locale has not been set.

      If this is the desired behavior, then we need to add a note in the documentation.

        Attachments

          Activity

            People

            • Assignee:
              ghalliday Gavin Halliday
              Reporter:
              johnholt John Holt
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: