Skip to content

Commit d2a6096

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Replace Hebrew characters with escape sequences
2 parents 4d18ab7 + 6926cf3 commit d2a6096

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ext/calendar/calendar.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,9 @@ enum { CAL_MONTH_GREGORIAN_SHORT, CAL_MONTH_GREGORIAN_LONG,
217217
CAL_MONTH_FRENCH
218218
};
219219

220-
/* for heb_number_to_chars */
221-
static char alef_bet[25] = "0àáâãäåæçèéëìîðñòôö÷øùú";
220+
/* For heb_number_to_chars escape sequences of אבגדהוזחטיכלמנסעפצקרשת
221+
ISO-8859-8 Hebrew alphabet */
222+
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";
222223

223224
#define CAL_JEWISH_ADD_ALAFIM_GERESH 0x2
224225
#define CAL_JEWISH_ADD_ALAFIM 0x4
@@ -505,7 +506,7 @@ PHP_FUNCTION(juliantojd)
505506
/* {{{ heb_number_to_chars*/
506507
/*
507508
caution: the Hebrew format produces non unique result.
508-
for example both: year '5' and year '5000' produce 'ä'.
509+
for example both: year '5' and year '5000' produce 'ה'.
509510
use the numeric one for calculations.
510511
*/
511512
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)
532533
p++;
533534
}
534535
if (CAL_JEWISH_ADD_ALAFIM & fl) {
535-
strcpy(p, " àìôéí ");
536+
/* Escape sequences of Hebrew characters in ISO-8859-8: אלפים */
537+
strcpy(p, " \xE0\xEC\xF4\xE9\xED ");
536538
p += 7;
537539
}
538540

0 commit comments

Comments
 (0)