mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
Document that NBSP_CHAR is not used in UTF-8 strings.
This commit is contained in:
parent
f2a3983389
commit
ae5fe80100
@ -183,7 +183,8 @@ u2cp_(unicode_val_T u, int to, enum nbsp_mode nbsp_mode)
|
|||||||
return encode_utf8(u);
|
return encode_utf8(u);
|
||||||
#endif /* CONFIG_UTF8 */
|
#endif /* CONFIG_UTF8 */
|
||||||
|
|
||||||
/* To mark non breaking spaces, we use a special char NBSP_CHAR. */
|
/* To mark non breaking spaces in non-UTF-8 strings, we use a
|
||||||
|
* special char NBSP_CHAR. */
|
||||||
if (u == 0xa0) {
|
if (u == 0xa0) {
|
||||||
if (nbsp_mode == NBSP_MODE_HACK) return NBSP_CHAR_STRING;
|
if (nbsp_mode == NBSP_MODE_HACK) return NBSP_CHAR_STRING;
|
||||||
else /* NBSP_MODE_ASCII */ return " ";
|
else /* NBSP_MODE_ASCII */ return " ";
|
||||||
|
@ -31,7 +31,8 @@ typedef uint32_t unicode_val_T;
|
|||||||
* We should fix that if we ever change the value. */
|
* We should fix that if we ever change the value. */
|
||||||
#define UCS_ORPHAN_CELL ((unicode_val_T) 0x20)
|
#define UCS_ORPHAN_CELL ((unicode_val_T) 0x20)
|
||||||
|
|
||||||
/* replacement character. See u2cp(). */
|
/* replacement character. See u2cp().
|
||||||
|
* UTF-8 strings should use the encoding of U+00A0 instead. */
|
||||||
#define NBSP_CHAR ((unsigned char) 1)
|
#define NBSP_CHAR ((unsigned char) 1)
|
||||||
#define NBSP_CHAR_STRING "\001"
|
#define NBSP_CHAR_STRING "\001"
|
||||||
|
|
||||||
@ -64,7 +65,8 @@ enum convert_string_mode {
|
|||||||
CSM_NONE, /* Convert nothing. */
|
CSM_NONE, /* Convert nothing. */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* How to translate non-breaking spaces. */
|
/* How to translate U+00A0 NO-BREAK SPACE. If u2cp_ is converting to
|
||||||
|
* UTF-8, it ignores this choice and just encodes the U+00A0. */
|
||||||
enum nbsp_mode {
|
enum nbsp_mode {
|
||||||
/* Convert to NBSP_CHAR. This lets the HTML renderer
|
/* Convert to NBSP_CHAR. This lets the HTML renderer
|
||||||
* recognize nbsp even if the codepage doesn't support
|
* recognize nbsp even if the codepage doesn't support
|
||||||
|
Loading…
Reference in New Issue
Block a user