Revision | 2951f885dc8336d3be8044fb6265dd4e6dbeb14d (tree) |
---|---|
Zeit | 2014-12-23 00:31:57 |
Autor | umorigu <umorigu@gmai...> |
Commiter | umorigu |
Improve handling of UTF-8 only functions
Now we don't need "//UTF-8 only" trailing comment for UTF-8 functions.
Converter understand PukiWiki 1.5.x specific source code and
prepend "//UTF-8:" comment heads to UTF-8 only lines on converting EUC-JP.
@@ -181,8 +181,13 @@ if [ "$__charconv" ] ; then | ||
181 | 181 | convert_UTF82EUCJP(){ |
182 | 182 | for list in "$@" ; do |
183 | 183 | # Very rough conversion! |
184 | - #sed 's/EUC-JP/UTF-8/g' "$list" > "$list.$$.tmp" && mv "$list.$$.tmp" "$list" | |
185 | - sed 's#^\(.*//UTF-8 only\)$#//UTF-8:\0#' "$list" > "$list.$$.tmp" && mv "$list.$$.tmp" "$list" | |
184 | + #sed 's/UTF-8/EUC-JP/g' "$list" > "$list.$$.tmp" && mv "$list.$$.tmp" "$list" | |
185 | + # This is very specific logit for PukiWiki 1.5.x source code | |
186 | + sed -i 's#^define('\''PKWK_UTF8_ENABLE'\'', *1);#//UTF-8:\0#' "$list" | |
187 | + sed -i 's#^case \+'\''ko'\'': *define('\''MB_LANGUAGE'\'', *'\''Korean'\''#//UTF-8:\0#' "$list" | |
188 | + sed -i 's#^[^a-zA-Z]*// *See *BugTrack2/13 *for *all#//UTF-8:\0#' "$list" | |
189 | + sed -i 's#^[^a-zA-Z]*// *and *give *us *your *report#//UTF-8:\0#' "$list" | |
190 | + | |
186 | 191 | done |
187 | 192 | } |
188 | 193 | fi > /dev/null |