$text = pack("C*", map {$_ & 127} unpack("C*", $text));
$text =~ s/[^\#a-zA-Z0-9]//g;
$text = substr($text, 0, $duplth) if length $text > $duplth;
$text = pack("C*", map {$_ & 127} unpack("C*", $text));
$text =~ s/[^\#a-zA-Z0-9]//g;
$text = substr($text, 0, $duplth) if length $text > $duplth;