Skip to content

Instantly share code, notes, and snippets.

@southly
Created August 29, 2010 02:14
Show Gist options
  • Save southly/555869 to your computer and use it in GitHub Desktop.
Save southly/555869 to your computer and use it in GitHub Desktop.
diff --git a/cgi-bin/w3m-2ch.cgi b/cgi-bin/w3m-2ch.cgi
index 7165415..02ae1d4 100755
--- a/cgi-bin/w3m-2ch.cgi
+++ b/cgi-bin/w3m-2ch.cgi
@@ -465,7 +465,7 @@ PrintBoardList()
$awk 'BEGIN {
FS = "[<>]"
- print "Content-Type: text/html"
+ print "Content-Type: text/html;charset=Shift_JIS"
print ""
print "<html><body>"\
"Click to jump to each of the categories."\
@@ -552,7 +552,7 @@ PrintThreadList()
ErrExit ${ERR_FILE} "${SCRIPT_NAME}: ${ptl_bdir}/subject.txt: No such file"
- echo Content-Type: text/html
+ echo "Content-Type: text/html;charset=Shift_JIS"
echo
echo "<html><head><title>"
GetBoardName ${ptl_bdir}
@@ -678,7 +678,7 @@ PrintLocalRule()
[ -s "${plr_bdir}/head.txt" ] ||
ErrExit ${ERR_FILE} "${SCRIPT_NAME}: not found"
- echo Content-Type: text/html
+ echo "Content-Type: text/html;charset=Shift_JIS"
echo
echo '<html><head><title>Local Rule@'
GetBoardName ${plr_bdir}
@@ -711,7 +711,7 @@ eu_print_from=$3 #
[ "${eu_print_from}" -eq 0 ] && return ${ERR_ARG}
-echo Content-Type: text/html
+echo "Content-Type: text/html;charset=Shift_JIS"
echo
echo "<html><head><title>URL list@${SCRIPT_NAME}</title></head><body>"
@@ -809,7 +809,7 @@ esac
em_nmesg=`echo ${em_lines} | $awk 'END { print NF }'`
cat <<EOF
-Content-type: text/html
+Content-Type: text/html;charset=Shift_JIS
<html><head><title>Message list@${SCRIPT_NAME}</title>
<body bgcolor=#efefef text=black link=blue alink=red vlink=#660099>
@@ -960,7 +960,7 @@ PopupMesg()
pm_res_num="$2"
cat <<EOF
-Content-Type: text/html
+Content-Type: text/html;charset=Shift_JIS
w3m-control: MARK_URL
<html><head><title>Popup mesg@${SCRIPT_NAME}</title></head><body>\
@@ -1228,7 +1228,7 @@ PrintThread()
# ここから表示を始める
#
cat <<EOF
-Content-Type: text/html
+Content-Type: text/html;charset=Shift_JIS
w3m-control: GOTO #${pt_goto}
w3m-control: DELETE_PREVBUF
w3m-control: MARK_URL
@@ -1429,7 +1429,7 @@ PrintKakoLog()
elif [ -r "${pkl_bdir}/${pkl_html}" ]; then
# htmlファイルがダウンロードされている時は cat で表示
cat <<EOF
-Content-type: text/html
+Content-Type: text/html;charset=Shift_JIS
w3m-control: MARK_URL
<html><body>&nbsp;\
@@ -1558,7 +1558,7 @@ PrintUpdate()
bname[$5] = $7
close(bbsmenu_html)
- print "Content-Type: text/html"
+ print "Content-Type: text/html;charset=Shift_JIS"
print ""
print "<html><head><title>" section "@" script_name "</title></head>"\
"<body bgcolor=#efefef text=black link=blue alink=red vlink=#660099>"\
@@ -1716,7 +1716,7 @@ PrintBookmark()
if [ ! -f "${BOOKMARK_FILE}" ]; then
cat <<EOF
-Content-Type: text/html
+Content-Type: text/html;charset=Shift_JIS
<html><head><title>[email protected]</title></head><body>
ブックマークが登録されていません。<br>
@@ -1736,7 +1736,7 @@ EOF
$awk 'BEGIN {
FS = "<>"
- print "Content-Type: text/html"
+ print "Content-Type: text/html;charset=Shift_JIS"
print ""
print "<html><head><title>Bookmark@'"${SCRIPT_NAME}"'</title></head>"
print "<body bgcolor=#efefef text=black link=blue alink=red vlink=#660099>"
@@ -1823,7 +1823,7 @@ SelectSection()
ss_pdat="$1"
- echo 'Content-Type: text/html'
+ echo 'Content-Type: text/html;charset=Shift_JIS'
echo
echo "<html><head><title>Bookmark Registration@${SCRIPT_NAME}</title><body>"
echo '<h1>Register to my bookmark</h1>'
@@ -2156,7 +2156,7 @@ EOF
pm_server_url="`GetBoardURL ${pm_bdir} | cut -d/ -f 1-3`"
- echo Content-Type: text/html
+ echo "Content-Type: text/html;charset=Shift_JIS"
echo
# wget 1.9.1 以降でなければ POST できない。
$wget --cookies=on --load-cookies "${COOKIE_FILE}" --save-cookies "${COOKIE_FILE}"\
@southly
Copy link
Author

southly commented Aug 29, 2010

http://www.geocities.jp/smug5680/

パッチの文字コードはShift_JIS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment