+ # Does $translator contain 8-bit characters?
+ TAB=' '
+ echo $translator | grep "[^${TAB} -~]" >/dev/null && {
+ # If so, grab the encoding from the po file.
+ charset=`sed -n '/Content-Type/{s/.*charset=//;s/\\\\n" *$//p;q}' $pofile`
+ # Use recode to generate HTML character codes for the 8-bit
+ # characters.
+ translator=`echo $translator | recode "${charset}..h4"` || exit 1
+ # The ampersands in the $translator entries will mess things
+ # up unless we escape 'em.
+ translator=`echo $translator | sed 's/&/\\\&/g'`
+ }
+