Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
bdf39320
...
bdf393200a9cc7c04ae7b92be78a581681401e75
authored
2004-06-04 23:25:00 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(rfc2047_decode): Implemented charset recoding using iconv
1 parent
df4fe98a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
mailbox/rfc2047.c
mailbox/rfc2047.c
View file @
bdf3932
...
...
@@ -69,7 +69,7 @@ rfc2047_decode (const char *tocode, const char *input, char **ptostr)
char
*
fromcode
=
NULL
;
char
*
encoding_type
=
NULL
;
char
*
encoded_text
=
NULL
;
stream_t
filter
=
NULL
;
stream_t
filter
=
NULL
,
cvt
=
NULL
;
stream_t
in_stream
=
NULL
;
const
char
*
filter_type
=
NULL
;
size_t
nbytes
=
0
,
size
;
...
...
@@ -116,19 +116,28 @@ rfc2047_decode (const char *tocode, const char *input, char **ptostr)
memory_stream_create
(
&
in_stream
,
0
,
0
);
stream_write
(
in_stream
,
encoded_text
,
size
,
0
,
NULL
);
filter_create
(
&
filter
,
in_stream
,
filter_type
,
MU_FILTER_DECODE
,
MU_STREAM_READ
);
status
=
filter_create
(
&
filter
,
in_stream
,
filter_type
,
MU_FILTER_DECODE
,
MU_STREAM_READ
);
if
(
status
!=
0
)
break
;
while
(
stream_sequential_read
(
filter
,
buffer
+
bufpos
,
status
=
filter_iconv_create
(
&
cvt
,
filter
,
fromcode
,
tocode
,
0
);
if
(
status
)
cvt
=
filter
;
if
(
stream_open
(
cvt
))
{
stream_destroy
(
cvt
,
stream_get_owner
(
cvt
));
cvt
=
filter
;
}
while
(
stream_sequential_read
(
cvt
,
buffer
+
bufpos
,
bufsize
-
bufpos
,
&
nbytes
)
==
0
&&
nbytes
)
{
/* FIXME: Need to convert character set */
bufpos
+=
nbytes
;
}
stream_close
(
filter
);
stream_destroy
(
&
filter
,
stream_get_owner
(
filter
));
stream_close
(
cvt
);
stream_destroy
(
&
cvt
,
stream_get_owner
(
cvt
));
fromstr
=
sp
+
1
;
run_count
=
1
;
...
...
Please
register
or
sign in
to post a comment