diff options
author | Peter Kokot <peterkokot@gmail.com> | 2019-02-21 22:46:41 +0100 |
---|---|---|
committer | Peter Kokot <peterkokot@gmail.com> | 2019-02-23 22:17:15 +0100 |
commit | 6926cf356e4aaa73dab4bcab1f703edb72b1b37c (patch) | |
tree | ef24bfe2af60122f844a8f630cac89200c67b522 /ext/calendar/calendar.c | |
parent | 139492b1ae67efe541f88f8d1f3183e40ad7636d (diff) | |
download | php-git-6926cf356e4aaa73dab4bcab1f703edb72b1b37c.tar.gz |
Replace Hebrew characters with escape sequences
calendar.c includes ISO-8859-8 encoded Hebrew characters, which may
cause compile errors, and is causing issues when saving file as UTF-8.
This patch replaces characters with appropriate escape sequences.
Following 99fdf5916eccbd72c10cc4d84693e677996b1229.
Diffstat (limited to 'ext/calendar/calendar.c')
-rw-r--r-- | ext/calendar/calendar.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c index 721311316f..3c7236de9a 100644 --- a/ext/calendar/calendar.c +++ b/ext/calendar/calendar.c @@ -217,8 +217,9 @@ enum { CAL_MONTH_GREGORIAN_SHORT, CAL_MONTH_GREGORIAN_LONG, CAL_MONTH_FRENCH }; -/* for heb_number_to_chars */ -static char alef_bet[25] = "0"; +/* For heb_number_to_chars escape sequences of אבגדהוזחטיכלמנסעפצקרשת + ISO-8859-8 Hebrew alphabet */ +static char alef_bet[25] = "0\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEB\xEC\xEE\xF0\xF1\xF2\xF4\xF6\xF7\xF8\xF9\xFA"; #define CAL_JEWISH_ADD_ALAFIM_GERESH 0x2 #define CAL_JEWISH_ADD_ALAFIM 0x4 @@ -505,7 +506,7 @@ PHP_FUNCTION(juliantojd) /* {{{ heb_number_to_chars*/ /* caution: the Hebrew format produces non unique result. -for example both: year '5' and year '5000' produce ''. +for example both: year '5' and year '5000' produce 'ה'. use the numeric one for calculations. */ static char *heb_number_to_chars(int n, int fl, char **ret) @@ -532,7 +533,8 @@ static char *heb_number_to_chars(int n, int fl, char **ret) p++; } if (CAL_JEWISH_ADD_ALAFIM & fl) { - strcpy(p, " "); + /* Escape sequences of Hebrew characters in ISO-8859-8: אלפים */ + strcpy(p, " \xE0\xEC\xF4\xE9\xED "); p += 7; } |