STR_LEN function evaluates UC_CRLF as 1 character in v24 and up - Automic Automation
search cancel

STR_LEN function evaluates UC_CRLF as 1 character in v24 and up - Automic Automation

book

Article ID: 451101

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine Automic Automation

Issue/Introduction

In Automic Automation v24 and higher, the STR_LEN() script function evaluates UC_CRLF (a combination of a Carriage Return and a Line Feed) as a single character rather than two. This change results from the implementation of full Multi-Language Unicode / UTF-8 support, which strictly adheres to the Unicode Standard Annex #29 (UAX #29) — Grapheme Cluster Boundaries. 

The following symptoms may occur:

  • Functions such as STR_LEN()STR_FIND(), and REPLACE() behave differently when processing CRLF sequences.
  • STR_LEN(UC_CRLF) returns 1 instead of 2.
  • The system evaluates CRLF as a single grapheme cluster.

Environment

Automic Automation Engine v24.0.0 and higher.

Cause

This is an intentional design change to ensure compliance with Unicode Standard Annex #29 (UAX #29), specifically Rule GB3. The sequence of a Carriage Return (CR) and a Line Feed (LF) is defined as a single grapheme cluster (a single user-perceived character) in Unicode, and the Automic Unicode library counts grapheme clusters rather than raw bytes or code points.

Resolution

This behavior is expected and is not a software defect. If scripts rely on processing Carriage Return (CR) and Line Feed (LF) as separate, individual characters, UC_CRLF() will no longer meet this requirement.

Instead, derive the carriage return and line feed individually using the HEX_2_STRING() function:

  1. Use the HEX_2_STRING() function to define the characters individually: :SET &cr# = HEX_2_STRING("0D") :SET &lf# = HEX_2_STRING("0A")
  2. Replace instances of UC_CRLF in your script with the concatenated &cr#&lf# string where individual character evaluation is required.

For further details, refer to the Automic Automation Incompatibilities Guide and the HEX_2_STRING Reference.

Additional Information