Patches for spreadsheet export

Hi,

attached two patches for the spreadsheet export against 3.9-trunk.

-Chris

0001-change-encoding-from-utf-8-to-cp1252.patch (1.4 KB)

0002-scrub-html-from-columnmap-values.patch (1.17 KB)

utf-8 didn’t work on Windows XP with Excel 2003.

Does it work on more modern Excels? This seems like a really odd
patch. I wonder if it would even work on Macs with Numbers.

  •    header => Encode::encode_utf8(loc($col->{title} || $col->{attribute})),
    
  •    header => Encode::encode( "cp1252", loc( $col->{title} || $col->{attribute} ) ),
    

Is there a reason not to use RT’s default scrubber?

+<%ONCE>
+my $scrubber = HTML::Scrubber->new();
+$scrubber->default(0);
+$scrubber->comment(0);
+</%ONCE>

-kevin

utf-8 didn’t work on Windows XP with Excel 2003.

Does it work on more modern Excels? This seems like a really odd
patch. I wonder if it would even work on Macs with Numbers.

Forgetting client issues for a minute, how would this patch work on
actual utf8 data (such as asian languages)

utf-8 didn’t work on Windows XP with Excel 2003.

Does it work on more modern Excels? This seems like a really odd
patch. I wonder if it would even work on Macs with Numbers.

Forgetting client issues for a minute, how would this patch work on
actual utf8 data (such as asian languages)
OK forget about the first patch.
I will try to test utf8 on more modern excel. If this still fails maybe
it makes sense to have a config value where you can override utf8
encoding if it doesn’t work for someone like me.

  •    header => Encode::encode_utf8(loc($col->{title} || $col->{attribute})),
    
  •    header => Encode::encode( "cp1252", loc( $col->{title} || $col->{attribute} ) ),
    

Is there a reason not to use RT’s default scrubber?
html/Elements/ScrubHTML don’t scrub all html tags but in this case we
have to scrub all.

Please follow my Reply-To, I read the list and don’t need two copies.

Am 16.12.2010 18:00, schrieb Kevin Falcone:

utf-8 didn’t work on Windows XP with Excel 2003.

Does it work on more modern Excels? This seems like a really odd
patch. I wonder if it would even work on Macs with Numbers.

Forgetting client issues for a minute, how would this patch work on
actual utf8 data (such as asian languages)
OK forget about the first patch.
I will try to test utf8 on more modern excel. If this still fails maybe
it makes sense to have a config value where you can override utf8
encoding if it doesn’t work for someone like me.

That sounds like a much less destructive option.

Is there a reason not to use RT’s default scrubber?
html/Elements/ScrubHTML don’t scrub all html tags but in this case we
have to scrub all.

+<%ONCE>
+my $scrubber = HTML::Scrubber->new();
+$scrubber->default(0);
+$scrubber->comment(0);
+</%ONCE>

Is the problem here that we’re getting HTML blown into the
spreadsheet, or that you’re getting broken html? If HTML is leaking,
then yes, we want some sort of scrub.

-kevin

If you are using the extension, the priority is enclosed by a span html
tag within the spreadsheet.
Just try the extension and you see what I mean. ;-)Am 16.12.2010 18:57, schrieb Kevin Falcone:

Is the problem here that we’re getting HTML blown into the
spreadsheet, or that you’re getting broken html? If HTML is leaking,
then yes, we want some sort of scrub.

Please obey my Reply-To

If you are using the extension, the priority is enclosed by a span html
tag within the spreadsheet.
Just try the extension and you see what I mean. :wink:

A modified patch with some comments about what is going on would be
good

-kevin

Am 16.12.2010 18:00, schrieb Kevin Falcone:

utf-8 didn’t work on Windows XP with Excel 2003.

Does it work on more modern Excels? This seems like a really odd
patch. I wonder if it would even work on Macs with Numbers.

Forgetting client issues for a minute, how would this patch work on
actual utf8 data (such as asian languages)

OK forget about the first patch.
I will try to test utf8 on more modern excel. If this still fails maybe
it makes sense to have a config value where you can override utf8
encoding if it doesn’t work for someone like me.

It doesn’t work for many as excel is stupid and expect that csv files
are in some preferred encoding, for example on ru Windows it should be
cp1251.

Best regards, Ruslan.

Am 16.12.2010 18:00, schrieb Kevin Falcone:

utf-8 didn’t work on Windows XP with Excel 2003.

Does it work on more modern Excels? This seems like a really odd
patch. I wonder if it would even work on Macs with Numbers.

Forgetting client issues for a minute, how would this patch work on
actual utf8 data (such as asian languages)

OK forget about the first patch.
I will try to test utf8 on more modern excel. If this still fails maybe
it makes sense to have a config value where you can override utf8
encoding if it doesn’t work for someone like me.

It doesn’t work for many as excel is stupid and expect that csv files
are in some preferred encoding, for example on ru Windows it should be
cp1251.

I’ve found the most convinient way to feed Excel with data is using
it’s XML format (no, not xslx, but MS Excel Speadsheet XML).
It should be well-formed UTF-8 XML.

Alexandr Kovalenko
http://uafug.org.ua/

Alexandr Kovalenko
http://uafug.org.ua/

It doesn’t work for many as excel is stupid and expect that csv files
are in some preferred encoding, for example on ru Windows it should be
cp1251.

That’s why I made RT::Extension::SearchResults::XLS :wink: