--- /dev/null
+#! /bin/sh
+set -e
+
+usage() {
+ echo "Usage: $0 [[from_enc] to_enc] filename" >&2
+ exit 1
+}
+
+if [ $# -eq 1 ]; then
+ from_enc="`python3 -c \"from m_lib.defenc import default_encoding; print(default_encoding)"`"
+ if [ "$from_enc" != utf-8 ]; then
+ to_enc=utf-8
+ else
+ usage
+ fi
+ filename="$1"
+elif [ $# -eq 2 ]; then
+ from_enc="`python3 -c \"from m_lib.defenc import default_encoding; print(default_encoding)"`"
+ to_enc="$1"
+ filename="$2"
+elif [ $# -eq 3 ]; then
+ from_enc="$1"
+ to_enc="$2"
+ filename="$3"
+else
+ usage
+fi
+
+cmd="`basename \"$0\"`"
+case "$cmd" in
+ cp_*) cmd="cp -p" ;;
+ mv_*) cmd=mv ;;
+ *)
+ echo "Uncnown command $0, aborting" >&2
+ exit 2
+ ;;
+esac
+
+filename_recoded=`echo "$filename" | iconv -f "$from_enc" -t "$to_enc"`
+exec $cmd "$filename" "$filename_recoded"