diff options
Diffstat (limited to 'src/mktable.c')
-rw-r--r-- | src/mktable.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/mktable.c b/src/mktable.c index 5f36ee3..1a624e7 100644 --- a/src/mktable.c +++ b/src/mktable.c @@ -2,7 +2,7 @@ mktable.c **********************************************************************/ /*- - * Copyright (c) 2002-2019 K.Kosako + * Copyright (c) 2002-2022 K.Kosako * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -638,24 +638,28 @@ static int IsPunct(int enc, int c) if (enc == ASCII) return ispunct(c); - if (enc == UNICODE_ISO_8859_1) { - if (c == 0x24 || c == 0x2b || c == 0x5e || c == 0x60 || - c == 0x7c || c == 0x7e) return 1; - if (c >= 0x3c && c <= 0x3e) return 1; - } - if (c >= 0x21 && c <= 0x2f) return 1; if (c >= 0x3a && c <= 0x40) return 1; if (c >= 0x5b && c <= 0x60) return 1; if (c >= 0x7b && c <= 0x7e) return 1; + if (enc == UNICODE_ISO_8859_1) { + if (c < 0x80) return 0; + + if (c >= 0xa1 && c <= 0xa9) return 1; + if (c >= 0xab && c <= 0xac) return 1; + if (c >= 0xae && c <= 0xb1) return 1; + if (c == 0xb4) return 1; + if (c >= 0xb6 && c <= 0xb8) return 1; + if (c == 0xbb || c == 0xbf || c == 0xd7 || c == 0xf7) return 1; + return 0; + } + switch (enc) { case ISO_8859_1: case ISO_8859_9: case ISO_8859_15: if (c == 0xad) return 1; - /* fall */ - case UNICODE_ISO_8859_1: if (c == 0xa1) return 1; if (c == 0xab) return 1; if (c == 0xb7) return 1; |