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
05505664
Commit
05505664
authored
Sep 25, 1997
by
Kenichi Handa
Browse files
(find_charset_in_str): Return also charsets in
composite characters.
parent
b7797a3e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
5 deletions
+35
-5
src/charset.c
src/charset.c
+35
-5
No files found.
src/charset.c
View file @
05505664
...
...
@@ -546,23 +546,53 @@ find_charset_in_str (str, len, charsets, table)
Lisp_Object
table
;
{
int
num
=
0
;
int
cmpcharp
=
0
;
unsigned
char
str_work
[
4
],
*
str_tmp
;
if
(
!
CHAR_TABLE_P
(
table
))
table
=
Qnil
;
while
(
len
>
0
)
{
int
bytes
=
BYTES_BY_CHAR_HEAD
(
*
str
);
int
charset
;
int
bytes
,
charset
;
if
(
*
str
==
LEADING_CODE_COMPOSITION
)
{
str
++
;
len
--
;
cmpcharp
=
1
;
}
else
if
(
CHAR_HEAD_P
(
str
))
cmpcharp
=
0
;
if
(
cmpcharp
)
{
if
(
*
str
==
0xA0
)
{
str
++
;
len
--
;
str_work
[
0
]
=
*
str
&
0x7F
;
}
else
{
bcopy
(
str
,
str_work
,
min
(
4
,
len
));
str_work
[
0
]
-=
0x20
;
}
str_tmp
=
str_work
;
}
else
str_tmp
=
str
;
bytes
=
BYTES_BY_CHAR_HEAD
(
*
str_tmp
);
if
(
NILP
(
table
))
charset
=
CHARSET_AT
(
str
);
charset
=
CHARSET_AT
(
str
_tmp
);
else
{
int
c
,
charset
;
int
c
;
unsigned
char
c1
,
c2
;
SPLIT_STRING
(
str
,
bytes
,
charset
,
c1
,
c2
);
SPLIT_STRING
(
str
_tmp
,
bytes
,
charset
,
c1
,
c2
);
if
((
c
=
unify_char
(
table
,
-
1
,
charset
,
c1
,
c2
))
>=
0
)
charset
=
CHAR_CHARSET
(
c
);
}
...
...
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