The space conversion function converts single-byte spaces in a character string to double-byte spaces, and vice versa. Because this function lets you know the conversion result without having to store character string data in a database, you can use the function for the following purposes:
For details about the specification configuration, see G.1(3)(b) Specification configuration.
stype (data type) | flags (conversion type) | |
---|---|---|
Single-byte space ![]() | Double-byte space ![]() | |
NCHAR | Checks two bytes at a time from the top and converts any two consecutive single-byte spaces to a double-byte space.* The function does not convert any isolated single-byte space. | Checks two bytes at a time from the top and converts any double-byte space* to two single-byte spaces. |
NVARCHAR | ||
MCHAR | Results in an error. | Checks each character code from the top and converts any double-byte space* to two single-byte spaces. |
MVARCHAR |
int p_rdb_conv_space(char *srcp, |
Macro name | Data type |
---|---|
PDSQL_NCHAR | NCHAR |
PDSQL_NVARCHAR | NVARCHAR |
PDSQL_MCHAR | MCHAR |
PDSQL_MVARCHAR | MVARCHAR |
Macro name | Conversion type |
---|---|
p_rdb_HALF_TO_FULL_SPACE | Single-byte space ![]() |
p_rdb_FULL_TO_HALF_SPACE | Double-byte space ![]() |
stype (data type) | flags (conversion type) | |
---|---|---|
Single-byte spaces -> Double-byte spaces | Double-byte spaces -> Single-byte spaces | |
MCHAR | An error occurs. | Character codes are checked from the beginning, and any double-byte spaces* found are converted into single-byte spaces. |
MVARCHAR |
* 0xE38080 is treated as a double-byte space character code.
int p_rdb_conv_space_utf8(char *srcp, |
Macro name | Data type |
---|---|
PDSQL_MCHAR | MCHAR |
PDSQL_MVARCHAR | MVARCHAR |
Macro name | Conversion type |
---|---|
p_rdb_FULL_TO_HALF_SPACE | Double-byte spaces -> Single-byte spaces |