"$pfx"[0-9a-fA-F][0-9a-fA-F]*) in="${in#${pfx}}";;
\\*) in="${in#?}"; out="${out}\\\\"; continue;;
%*) in="${in#?}"; out="${out}%%"; continue;;
- *) out="${out}${in%"${in#?}"}"; in="${in#?}"; continue;;
+ *) att="${in%%"${pfx}"*}"; att="${att%%%*}"; att="${att%%\\*}"
+ out="${out}${att}"; in="${in#"${att}"}"; continue;;
esac;
# Hex escapes for printf (e.g. \x41) are not portable
"${CR}"*) out="${out}%0D"; str="${str#?}";;
"${BR}"*) out="${out}%0A"; str="${str#?}";;
%*) out="${out}%25"; str="${str#?}";;
- *) out="${out}${str%%[]&\"\'# ${CR}${BR}[]*}"; str="${str#"${str%%[]&\"\'# ${CR}${BR}[]*}"}";;
+ *) out="${out}${str%%[]&\"\'\?# ${CR}${BR}%[]*}"; str="${str#"${str%%[]&\"\'\?# ${CR}${BR}%[]*}"}";;
esac; done
printf %s "$out"
}