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
1241e8b4
...
1241e8b4f93369574d825b263028c06925ec0ea3
authored
2005-09-29 11:03:47 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Allow to specify charset from the command line
1 parent
150944be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
examples/decode2047.c
examples/decode2047.c
View file @
1241e8b
...
...
@@ -43,10 +43,14 @@ main (int argc, char *argv[])
{
char
buf
[
256
];
int
c
,
printable
=
0
;
while
((
c
=
getopt
(
argc
,
argv
,
"p"
))
!=
EOF
)
char
*
charset
=
"iso-8859-1"
;
while
((
c
=
getopt
(
argc
,
argv
,
"c:p"
))
!=
EOF
)
switch
(
c
)
{
case
'c'
:
charset
=
optarg
;
break
;
case
'p'
:
printable
=
1
;
break
;
...
...
@@ -63,7 +67,7 @@ main (int argc, char *argv[])
len
=
strlen
(
buf
);
if
(
len
>
0
&&
buf
[
len
-
1
]
==
'\n'
)
buf
[
len
-
1
]
=
0
;
rc
=
mu_rfc2047_decode
(
"iso-8859-1"
,
buf
,
&
p
);
rc
=
mu_rfc2047_decode
(
charset
,
buf
,
&
p
);
printf
(
"%s=> %s
\n
"
,
buf
,
mu_strerror
(
rc
));
if
(
p
)
print
(
p
,
printable
);
...
...
Please
register
or
sign in
to post a comment