+my $ii = 0;
+while (my $row = $Tickets->Next) {
+ for my $col (@columns) {
+ $m->out(join("\t", map {
+ my $val = ProcessColumnMapValue($_->{map}, Arguments => [$row, $ii++], Escape => 0);
+ $val = loc($val) if $_->{should_loc};
+ # remove tabs from all field values, they screw up the tsv
+ $val = '' unless defined $val;
+ $val =~ s/(?:\n|\r)//g; $val =~ s{\t}{ }g;
+ $val = $no_html->scrub($val);
+ $val = HTML::Entities::decode_entities($val);
+ Encode::encode_utf8($val);
+ } @$col)."\n");
+ }
+}