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

Mailing List Archive: Catalyst: Users

UTF-8 Conversion on the fly

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


amesdaq at websense

May 23, 2008, 10:06 AM

Post #1 of 2 (209 views)
Permalink
UTF-8 Conversion on the fly

Hello Everyone,

Got a question about utf8 conversions on the fly. I was wondering if
anyone had experience and some pointers of good practices for taking a
webpage thats stored as a blob in mysql then serving that page after its
been converted to utf8. Right now the way this is implemented is
conversion before storage but I never liked that idea. The engineer who
did it thought utf8 conversion is always going to be a smooth thing. I
also don't like the fact we don't store the orginal copy of the page in
the db its the converted copy. So I wanted to see if anyone here had
good suggestions on how the original can be stored and just converted on
the fly.

Thanks,
------------------------------------------
Ali Mesdaq (CISSP, GIAC-GREM)
Security Researcher II
Websense Security Labs
http://www.WebsenseSecurityLabs.com
------------------------------------------


Protected by Websense Messaging Security -- www.websense.com

_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


jon at jrock

May 23, 2008, 10:23 AM

Post #2 of 2 (195 views)
Permalink
Re: UTF-8 Conversion on the fly [In reply to]

* On Fri, May 23 2008, Mesdaq, Ali wrote:
> Hello Everyone,
>
> Got a question about utf8 conversions on the fly. I was wondering if
> anyone had experience and some pointers of good practices for taking a
> webpage thats stored as a blob in mysql then serving that page after its
> been converted to utf8. Right now the way this is implemented is
> conversion before storage but I never liked that idea. The engineer who
> did it thought utf8 conversion is always going to be a smooth thing. I
> also don't like the fact we don't store the orginal copy of the page in
> the db its the converted copy. So I wanted to see if anyone here had
> good suggestions on how the original can be stored and just converted on
> the fly.

I'm not sure what this has to do with Catalyst, but just store the
original data and the encoding in the database, then

my $octets =
Encode::encode('utf-8', Encode::decode($stored_encoding, $stored_webpage));

Regards,
Jonathan Rockway

--
print just => another => perl => hacker => if $,=$"

_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.