Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
cc13543e
Commit
cc13543e
authored
Jun 16, 2009
by
Kenichi Handa
Browse files
(detect_coding_utf_16): Fix previous change.
parent
9c6d2887
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
src/ChangeLog
src/ChangeLog
+5
-0
src/coding.c
src/coding.c
+8
-8
No files found.
src/ChangeLog
View file @
cc13543e
2009-06-16 Kenichi Handa <handa@m17n.org>
* coding.c (detect_coding_utf_16): Fix the logic of rejecting
UTF-16 by checking the dispersion of Eth and Oth bytes.
2009-06-15 Andreas Schwab <schwab@linux-m68k.org>
* coding.c (detect_coding_utf_16): Fix typo counting odd bytes.
...
...
src/coding.c
View file @
cc13543e
...
...
@@ -1665,10 +1665,11 @@ detect_coding_utf_16 (coding, detect_info)
e[c1] = 1;
o[c2] = 1;
detect_info->rejected
|= (CATEGORY_MASK_UTF_16_BE | CATEGORY_MASK_UTF_16_LE);
detect_info->rejected |= (CATEGORY_MASK_UTF_16_AUTO
|CATEGORY_MASK_UTF_16_BE
| CATEGORY_MASK_UTF_16_LE);
while (
1
)
while (
detect_info->rejected != CATEGORY_MASK_UTF_16
)
{
TWO_MORE_BYTES (c1, c2);
if (c2 < 0)
...
...
@@ -1677,18 +1678,17 @@ detect_coding_utf_16 (coding, detect_info)
{
e[c1] = 1;
e_num++;
if (e_num >=
128 && o_num >=
128)
break
;
if (e_num >= 128)
detect_info->rejected |= CATEGORY_MASK_UTF_16_BE_NOSIG
;
}
if (! o[c2])
{
o[c2] = 1;
o_num++;
if (
e_num >= 128 &&
o_num >= 128)
break
;
if (o_num >= 128)
detect_info->rejected |= CATEGORY_MASK_UTF_16_LE_NOSIG
;
}
}
detect_info->rejected |= CATEGORY_MASK_UTF_16;
return 0;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment