tuple_chrtuple_chrTupleChrTupleChrtuple_chr (Operator)
名称
tuple_chrtuple_chrTupleChrTupleChrtuple_chr — 将整数元组转换为字符串。ANSI 整数转换为字符。整数数组将转换为单个字符的数组。Chr 是 character 的缩写,即将 ASCII/ASNI 编码转换为字符。
签名
Herror tuple_chr(const Hlong T, char* Chr)
Herror T_tuple_chr(const Htuple T, Htuple* Chr)
def tuple_chr(t: MaybeSequence[int]) -> Sequence[str]
def tuple_chr_s(t: MaybeSequence[int]) -> str
描述
tuple_chrtuple_chrTupleChrTupleChrTupleChrtuple_chr converts the input tuple TTTTtt, consisting of integer
numbers, into a tuple of strings, each of length 1.
When the encoding used in the HALCON library is UTF-8 (see
set_system('filename_encoding', 'utf8')set_system("filename_encoding", "utf8")SetSystem("filename_encoding", "utf8")SetSystem("filename_encoding", "utf8")SetSystem("filename_encoding", "utf8")set_system("filename_encoding", "utf8")) and the string operators
are set to work by code points (see
set_system('tuple_string_operator_mode', 'codepoint')set_system("tuple_string_operator_mode", "codepoint")SetSystem("tuple_string_operator_mode", "codepoint")SetSystem("tuple_string_operator_mode", "codepoint")SetSystem("tuple_string_operator_mode", "codepoint")set_system("tuple_string_operator_mode", "codepoint")), which is the
default for both, the operator accepts Unicode character codes and
returns strings with the appropriate UTF-8 representations of the characters.
When the HALCON library encoding is set to 'locale'"locale""locale""locale""locale""locale" or the string
operator mode is 'byte'"byte""byte""byte""byte""byte", the operator accepts only numbers between
0 and 256.
In that case the operator tuple_chrtuple_chrTupleChrTupleChrTupleChrtuple_chr returns strings with one byte
length each, where the input number is set as ANSI code.
See also Tuple / String Operations for a more detailed description
of the different modes and further encoding issues.
If the input tuple is empty, the operator returns an empty tuple.
HDevelop In-line Operation
HDevelop provides an in-line operation for tuple_chrtuple_chrTupleChrTupleChrTupleChrtuple_chr,
which can be used in an expression in the following syntax:
Chr := chr(T)
执行信息
- Multithreading type: independent (runs in parallel even with exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
参数
TTTTtt (input_control) integer(-array) → HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Input tuple with Unicode character codes or ANSI codes.
限制:
0 <= T
ChrChrChrChrchrchr (output_control) string(-array) → HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)
Output tuple with strings built from the character codes in the
input tuple.
替代算子
tuple_chrttuple_chrtTupleChrtTupleChrtTupleChrttuple_chrt
另见
tuple_ordtuple_ordTupleOrdTupleOrdTupleOrdtuple_ord,
tuple_ordstuple_ordsTupleOrdsTupleOrdsTupleOrdstuple_ords
模块
Foundation