首页 > 解决方案 > PCRE2_CODE_UNIT_WIDTH 不是 8

问题描述

我有以下pcre2导入,我将其用作一种占位符/默认值:

/* The PCRE2_CODE_UNIT_WIDTH macro must be defined before including pcre2.h.
For a program that uses only one code unit width, setting it to 8, 16, or 32
makes it possible to use generic function names such as pcre2_compile(). */

#define PCRE2_CODE_UNIT_WIDTH 8
#include <pcre2.h>

在什么情况下代码宽度不是 8?例如,对于非 asci/utf-8 字符,代码宽度应该设置为 16 还是 8?非 8 位宽度的最常见用法是什么?

标签: cpcre

解决方案


推荐阅读