]> granicus.if.org Git - multimarkdown/commitdiff
CHANGED: Extended ASCII support interferes with UTF-8 support -- disable it
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Sat, 13 May 2017 00:04:16 +0000 (20:04 -0400)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Sat, 13 May 2017 00:04:16 +0000 (20:04 -0400)
Sources/libMultiMarkdown/char.c
Sources/libMultiMarkdown/char.h
Sources/libMultiMarkdown/char_lookup.c

index 1791bdac3f5675ee99512b86e0d3ebb0042e54cc..f9d12592f401598acb8702d52124413eda47f82e 100644 (file)
@@ -67,14 +67,14 @@ static unsigned char smart_char_type[256] = {
   4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  2,  2,  2,  2,  2,
   2,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,
   4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  2,  2,  2,  2,  0,
-  2,  0,  2,  4,  2,  2,  2,  2,  2,  2,  4,  2,  4,  0,  4,  0,
-  0,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  4,  0,  4,  4,
-  1,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
-  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
-  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,
-  4,  4,  4,  4,  4,  4,  4,  2,  4,  4,  4,  4,  4,  4,  4,  4,
-  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,
-  4,  4,  4,  4,  4,  4,  4,  2,  4,  4,  4,  4,  4,  4,  4,  4
+  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
 };
 
 
index acd50afa1a67c37b322e4cd38565284116a3225d..f14ae502eb101d997c39fd9b71fcd91d1c80118b 100644 (file)
@@ -103,5 +103,9 @@ int char_is_whitespace_or_line_ending_or_punctuation(char c);
 // Is byte a UTF-8 continuation byte
 #define char_is_continuation_byte(x) ((x & 0xC0) == 0x80)
 
+// Is byte the first byte of a multibyte UTF-8 sequence?
+#define char_is_lead_multibyte(x) ((x & 0xC0) == 0xC0)
+
+
 #endif
 
index c932c7d7eddbe7761c48dfb579194b3b1c02547e..bcf59db4acd05b7e4589567d538111cf62249bf5 100644 (file)
@@ -65,6 +65,7 @@
 #define digit(x)               table[x] |= CHAR_DIGIT
 #define line_ending(x) table[x] |= CHAR_LINE_ENDING
 
+#define USE_EXTENDED_ASCII_disabled 1
 
 int main( int argc, char** argv ) {
        unsigned char table[256] = {0};
@@ -140,7 +141,7 @@ int main( int argc, char** argv ) {
 
 
        // Extended ASCII
-
+#ifdef USE_EXTENDED_ASCII
        // Punctuation ranges
        for (int i = 132; i < 138; ++i) {
                punctuation(i);
@@ -194,7 +195,7 @@ int main( int argc, char** argv ) {
                                break;
                }
        }
-
+#endif
 
 
        // Print output as 16 x 16 table