Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Devel

patches for spreadsheet export

 

 

Request Tracker devel RSS feed   Index | Next | Previous | View Threaded


cloos at netsandbox

Dec 16, 2010, 8:46 AM

Post #1 of 9 (1536 views)
Permalink
patches for spreadsheet export

Hi,

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

-Chris
Attachments: 0001-change-encoding-from-utf-8-to-cp1252.patch (1.40 KB)
  0002-scrub-html-from-columnmap-values.patch (1.17 KB)


falcone at bestpractical

Dec 16, 2010, 8:56 AM

Post #2 of 9 (1508 views)
Permalink
Re: patches for spreadsheet export [In reply to]

> 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


falcone at bestpractical

Dec 16, 2010, 9:00 AM

Post #3 of 9 (1503 views)
Permalink
Re: patches for spreadsheet export [In reply to]

On Thu, Dec 16, 2010 at 11:56:35AM -0500, Kevin Falcone wrote:
> > 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)

> > - 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>


cloos at netsandbox

Dec 16, 2010, 9:46 AM

Post #4 of 9 (1502 views)
Permalink
Re: patches for spreadsheet export [In reply to]

Am 16.12.2010 18:00, schrieb Kevin Falcone:
> On Thu, Dec 16, 2010 at 11:56:35AM -0500, Kevin Falcone wrote:
>>> 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.
>>
>>> +<%ONCE>
>>> +my $scrubber = HTML::Scrubber->new();
>>> +$scrubber->default(0);
>>> +$scrubber->comment(0);
>>> +</%ONCE>
>>>
>>>
>>> _______________________________________________
>>> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel

_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


falcone at bestpractical

Dec 16, 2010, 9:57 AM

Post #5 of 9 (1496 views)
Permalink
Re: patches for spreadsheet export [In reply to]

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

On Thu, Dec 16, 2010 at 06:46:27PM +0100, Christian Loos wrote:
> Am 16.12.2010 18:00, schrieb Kevin Falcone:
> > On Thu, Dec 16, 2010 at 11:56:35AM -0500, Kevin Falcone wrote:
> >>> 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


cloos at netcologne

Dec 17, 2010, 10:09 AM

Post #6 of 9 (1494 views)
Permalink
Re: patches for spreadsheet export [In 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. ;-)

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.
_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


falcone at bestpractical

Dec 17, 2010, 10:18 AM

Post #7 of 9 (1493 views)
Permalink
Re: patches for spreadsheet export [In reply to]

Please obey my Reply-To

On Fri, Dec 17, 2010 at 07:09:01PM +0100, Christian Loos wrote:
> 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. ;-)

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

-kevin

> 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.


ruz at bestpractical

Dec 21, 2010, 7:00 AM

Post #8 of 9 (1449 views)
Permalink
Re: patches for spreadsheet export [In reply to]

On Thu, Dec 16, 2010 at 8:46 PM, Christian Loos <cloos [at] netsandbox> wrote:
> Am 16.12.2010 18:00, schrieb Kevin Falcone:
>> On Thu, Dec 16, 2010 at 11:56:35AM -0500, Kevin Falcone wrote:
>>>> 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.
_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


elacour at easter-eggs

Dec 26, 2010, 11:08 AM

Post #9 of 9 (1404 views)
Permalink
Re: patches for spreadsheet export [In reply to]

On Tue, Dec 21, 2010 at 06:00:07PM +0300, Ruslan Zakirov wrote:
>
> 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 ;)


_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel

Request Tracker devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.