Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
48bf81f6
Commit
48bf81f6
authored
Apr 01, 2003
by
bar@bar.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
charset2html.c:
It's now working under HTTPD as a CGI. Very convenient!
parent
ca1a7362
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
2 deletions
+37
-2
mysys/charset2html.c
mysys/charset2html.c
+37
-2
No files found.
mysys/charset2html.c
View file @
48bf81f6
...
...
@@ -64,7 +64,7 @@ static void print_cs(CHARSET_INFO *cs)
for
(
i
=
0
;
i
<
256
;
i
++
)
{
ch
[
i
].
cod
=
i
;
ch
[
i
].
srt
=
cs
->
sort_order
[
i
]
;
ch
[
i
].
srt
=
cs
->
sort_order
?
cs
->
sort_order
[
i
]
:
i
;
ch
[
i
].
uni
=
cs
->
tab_to_uni
[
i
];
ch
[
i
].
low
=
cs
->
tab_to_uni
[
cs
->
to_lower
[
i
]];
ch
[
i
].
upp
=
cs
->
tab_to_uni
[
cs
->
to_upper
[
i
]];
...
...
@@ -104,12 +104,41 @@ static void print_cs(CHARSET_INFO *cs)
printf
(
"</HTML>
\n
"
);
}
static
void
print_index
()
{
CHARSET_INFO
**
cs
;
int
clr
=
0
;
get_charset_by_name
(
""
,
MYF
(
0
));
/* To execute init_available_charsets */
printf
(
"All charsets
\n
"
);
printf
(
"<table border=1>
\n
"
);
printf
(
"<tr bgcolor=EEEE99><th>ID<th>Charset<th>Collation<th>Def<th>Bin<th>Com<th>Comment
\n
"
);
for
(
cs
=
all_charsets
;
cs
<
all_charsets
+
256
;
cs
++
)
{
if
(
!
cs
[
0
])
continue
;
printf
(
"<tr bgcolor=#%s><td><a href=
\"
?%s
\"
>%d</a><td>%s<td>%s<td>%s<td>%s<td>%s<td>%s
\n
"
,
(
clr
=
!
clr
)
?
"DDDDDD"
:
"EEEE99"
,
cs
[
0
]
->
name
,
cs
[
0
]
->
number
,
cs
[
0
]
->
csname
,
cs
[
0
]
->
name
,
(
cs
[
0
]
->
state
&
MY_CS_PRIMARY
)
?
"def "
:
" "
,
(
cs
[
0
]
->
state
&
MY_CS_BINSORT
)
?
"bin "
:
" "
,
(
cs
[
0
]
->
state
&
MY_CS_COMPILED
)
?
"com "
:
" "
,
cs
[
0
]
->
comment
);
}
printf
(
"</table>
\n
"
);
}
int
main
(
int
argc
,
char
**
argv
)
{
const
char
*
the_set
=
MYSQL_CHARSET
;
const
char
*
the_set
=
NULL
;
int
argcnt
=
1
;
CHARSET_INFO
*
cs
;
if
(
getenv
(
"SCRIPT_NAME"
))
{
printf
(
"Content-Type: text/html
\r\n\r\n
"
);
}
my_init
();
if
(
argc
>
argcnt
&&
argv
[
argcnt
][
0
]
==
'-'
&&
argv
[
argcnt
][
1
]
==
'#'
)
...
...
@@ -121,6 +150,12 @@ int main(int argc, char **argv) {
if
(
argc
>
argcnt
)
charsets_dir
=
argv
[
argcnt
++
];
if
(
!
the_set
)
{
print_index
();
return
0
;
}
if
(
!
(
cs
=
get_charset_by_name
(
the_set
,
MYF
(
MY_WME
))))
return
1
;
...
...
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