summaryrefslogtreecommitdiff
path: root/enc/utf_8.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-17 07:42:23 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-17 07:42:23 +0000
commit0424e152c684a85f4b0691f1e84aec203115333d (patch)
treeccb4af1c7fa12a09934f315edba0b9d839e57ceb /enc/utf_8.c
parent5362e7fcddf70d16fc4261383f99175c90881353 (diff)
* Merge Onigmo-5.13.1. [ruby-dev:45057] [Feature #5820]
https://github.com/k-takata/Onigmo cp reg{comp,enc,error,exec,parse,syntax}.c reg{enc,int,parse}.h cp oniguruma.h cp tool/enc-unicode.rb cp -r enc/ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc/utf_8.c')
-rw-r--r--enc/utf_8.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/enc/utf_8.c b/enc/utf_8.c
index 83f8701205..dae1f3a1bc 100644
--- a/enc/utf_8.c
+++ b/enc/utf_8.c
@@ -248,9 +248,7 @@ is_mbc_newline(const UChar* p, const UChar* end, OnigEncoding enc)
if (*p == 0x0a) return 1;
#ifdef USE_UNICODE_ALL_LINE_TERMINATORS
-#ifndef USE_CRNL_AS_LINE_TERMINATOR
- if (*p == 0x0d) return 1;
-#endif
+ if (*p == 0x0b || *p == 0x0c || *p == 0x0d) return 1;
if (p + 1 < end) {
if (*(p+1) == 0x85 && *p == 0xc2) /* U+0085 */
return 1;
@@ -272,7 +270,7 @@ mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
int c, len;
OnigCodePoint n;
- len = enclen(enc, p, end);
+ len = mbc_enc_len(p, end, enc);
c = *p++;
if (len > 1) {
len--;
@@ -363,7 +361,7 @@ code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc ARG_UNUSED)
}
*p++ = UTF8_TRAIL0(code);
- return (int)(p - buf);
+ return (int )(p - buf);
}
}
@@ -440,7 +438,9 @@ OnigEncodingDefine(utf_8, UTF_8) = {
onigenc_unicode_is_code_ctype,
get_ctype_code_range,
left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match
+ onigenc_always_true_is_allowed_reverse_match,
+ 0,
+ ONIGENC_FLAG_UNICODE,
};
ENC_ALIAS("CP65001", "UTF-8")