Re: [Catalyst] authentication

2011-03-12 Thread shawn wilson
Good point, I'll read up into the appropriate way to install cc numbers (I'm
sure there's more on pci than I care to know) which should get me to where I
want to be. I'll look into how many email servers and services support oauth
and see how well that might work but I have my doubts. Thanks for the help.
On Mar 12, 2011 4:06 PM, "Peter Edwards"  wrote:
> Check out whether you can use OAuth as a limited form of permission
without
> using their password. Otherwise you are in
> storing-credit-card-nos-on-my-server territory (not a happy place)
> On 12 Mar 2011 20:33, "shawn wilson"  wrote:
>> On Sat, Mar 12, 2011 at 3:08 PM, Peter Edwards >wrote:
>>
>>> On 12 March 2011 19:41, shawn wilson  wrote:
>>>
 i am working on an app that allows users to access (and do some things)
 with email. however, i want a method of storing their password that
> would
 require them accessing the site in order for me to be able to decrypt.
i
> was
 thinking of encrypting it based on the key that
 Catalyst::Plugin::Authentication uses to store credentials on their
end.
> i
 also thought that maybe i could store some other field in that cookie
> that
 maybe had a seed.

 however, i was hoping that maybe someone would point out that this
could
 be done totally internal to that authentication module or maybe another
 module does this? and maybe there's some sort of flaw in my ideas? or
> maybe
 someone on here has done something similar they'd be willing to share?


>>> You haven't really given enough details of what you want to do for
people
>>> to be able to give a good and secure answer.
>>> In general you need to create a token based upon a secure authentication
>>> (like the way OAuth does) and use that.
>>> However, it's not clear whether your token is passed in clear text or a
>>> breakable session (in which case you need a one time key) or something
> else.
>>> Of course email itself is insecure unless over SSL and even then a
> recorded
>>> session could be broken in time.
>>> Regards, Peter (with his black hat on)
>>>
>>>
>> i guess my main thing was a way to say to a user, you can give me the
>> password to your email, i don't know what it is and have no way of easily
>> obtaining it unless you login. i don't think that keeping a plain text of
>> their pass in their cookie is good (obviously). email itself is insecure,
>> however i think most people do login to their email securely.
>>
>> I think what i'm looking for is some type of one way hash that depends on
>> something i can get from their session.
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Unicode::Encoding - utf8 "\xBA" does not map to Unicode

2011-03-12 Thread Eisenberger Tamás
Hy!

As others pointed out, the real problem is with the url you try to use,
that I skimmed over.

As Bernhard Graf wrote:
"When you have 'first_name=K%E9vyn' in an URL, the
meaning of %E9 is actually ambiguous, because there is no information
about the encoding. Fortunately RFC 3986 advises to encode all "reserved
characters" as UTF-8 before transforming them into the URI-percent
encoding, because percent encoding only works with bytes (octets). In
that sense, "K%E9vyn" is simply invalid, because "\xE9" alone is no
valid UTF-8 encoded character. What you have there is obviously the
percent encoding of the ISO-8859-1 encoding of "Kévyn". Therefore the
correct RFC 3986 compliant URI-encoding for "Kévyn" would be "K%C3%
A9vyn"."

-- 
Eisenberger Tamás 

On Sat, 2011-03-12 at 22:05 +, ryan lauterbach wrote:
> On 12 March 2011 22:04, ryan lauterbach  wrote:
> > 2011/3/12 Eisenberger Tamás :
> >>
> >> This seems like some conflict between plugins, can you tell us what
> >> plugins you use, with their versions...
> 
> Everything updated yesterday.
> 
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/


smime.p7s
Description: S/MIME cryptographic signature
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Unicode::Encoding - utf8 "\xBA" does not map to Unicode

2011-03-12 Thread ryan lauterbach
On 12 March 2011 22:04, ryan lauterbach  wrote:
> 2011/3/12 Eisenberger Tamás :
>>
>> This seems like some conflict between plugins, can you tell us what
>> plugins you use, with their versions...

Everything updated yesterday.

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


Re: [Catalyst] Unicode::Encoding - utf8 "\xBA" does not map to Unicode

2011-03-12 Thread ryan lauterbach
2011/3/12 Eisenberger Tamás :
>
> This seems like some conflict between plugins, can you tell us what
> plugins you use, with their versions, catalyst's version and the order
> of plugins loaded? The order does matter in case of C::P::U::E because
> it should be the first getting the input!

I can remove all but the below to have the controller still work.  The
error is the same whether placing Kévyn or K%E9vyn in the url.  As a
side note the browsers seem to change the é into %E9 in the URL bar
(FF and Chrome at least).

Unicode::Encoding
Authentication
Authorization::Roles
Authorization::ACL

What else could be encoding the query params before U::E?  URI? HTTP::Body?

Thanks for the help.

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


Re: [Catalyst] Authentication with REST and Catalyst

2011-03-12 Thread Bill Moseley
On Sat, Mar 12, 2011 at 6:14 AM, Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯  wrote:


>
> This being REST, Cookies are right out.
>

Because state is then no longer only contained in the URL?

It's pretty easy to find APIs that claim ReSTful-type interfaces that use
cookies.


-- 
Bill Moseley
mose...@hank.org
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] authentication

2011-03-12 Thread Peter Edwards
Check out whether you can use OAuth as a limited form of permission without
using their password.  Otherwise you are in
storing-credit-card-nos-on-my-server territory (not a happy place)
On 12 Mar 2011 20:33, "shawn wilson"  wrote:
> On Sat, Mar 12, 2011 at 3:08 PM, Peter Edwards wrote:
>
>> On 12 March 2011 19:41, shawn wilson  wrote:
>>
>>> i am working on an app that allows users to access (and do some things)
>>> with email. however, i want a method of storing their password that
would
>>> require them accessing the site in order for me to be able to decrypt. i
was
>>> thinking of encrypting it based on the key that
>>> Catalyst::Plugin::Authentication uses to store credentials on their end.
i
>>> also thought that maybe i could store some other field in that cookie
that
>>> maybe had a seed.
>>>
>>> however, i was hoping that maybe someone would point out that this could
>>> be done totally internal to that authentication module or maybe another
>>> module does this? and maybe there's some sort of flaw in my ideas? or
maybe
>>> someone on here has done something similar they'd be willing to share?
>>>
>>>
>> You haven't really given enough details of what you want to do for people
>> to be able to give a good and secure answer.
>> In general you need to create a token based upon a secure authentication
>> (like the way OAuth does) and use that.
>> However, it's not clear whether your token is passed in clear text or a
>> breakable session (in which case you need a one time key) or something
else.
>> Of course email itself is insecure unless over SSL and even then a
recorded
>> session could be broken in time.
>> Regards, Peter (with his black hat on)
>>
>>
> i guess my main thing was a way to say to a user, you can give me the
> password to your email, i don't know what it is and have no way of easily
> obtaining it unless you login. i don't think that keeping a plain text of
> their pass in their cookie is good (obviously). email itself is insecure,
> however i think most people do login to their email securely.
>
> I think what i'm looking for is some type of one way hash that depends on
> something i can get from their session.
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] authentication

2011-03-12 Thread shawn wilson
On Sat, Mar 12, 2011 at 3:08 PM, Peter Edwards wrote:

> On 12 March 2011 19:41, shawn wilson  wrote:
>
>> i am working on an app that allows users to access (and do some things)
>> with email. however, i want a method of storing their password that would
>> require them accessing the site in order for me to be able to decrypt. i was
>> thinking of encrypting it based on the key that
>> Catalyst::Plugin::Authentication uses to store credentials on their end. i
>> also thought that maybe i could store some other field in that cookie that
>> maybe had a seed.
>>
>> however, i was hoping that maybe someone would point out that this could
>> be done totally internal to that authentication module or maybe another
>> module does this? and maybe there's some sort of flaw in my ideas? or maybe
>> someone on here has done something similar they'd be willing to share?
>>
>>
> You haven't really given enough details of what you want to do for people
> to be able to give a good and secure answer.
> In general you need to create a token based upon a secure authentication
> (like the way OAuth does) and use that.
> However, it's not clear whether your token is passed in clear text or a
> breakable session (in which case you need a one time key) or something else.
> Of course email itself is insecure unless over SSL and even then a recorded
> session could be broken in time.
> Regards, Peter (with his black hat on)
>
>
i guess my main thing was a way to say to a user, you can give me the
password to your email, i don't know what it is and have no way of easily
obtaining it unless you login. i don't think that keeping a plain text of
their pass in their cookie is good (obviously). email itself is insecure,
however i think most people do login to their email securely.

I think what i'm looking for is some type of one way hash that depends on
something i can get from their session.
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Authentication with REST and Catalyst

2011-03-12 Thread linuxsupport
Thank you so much, I will try TLS and see how it goes.

On Sat, Mar 12, 2011 at 7:44 PM, Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯  wrote:

> If you think of cobbling together your own authentication scheme, don't.
> You
> will make mistakes and introduce weaknesses. Use the established ones, in
> decreasing order of preference:
>
> * TLS, e.g.
>  
> * WSSE, e.g. , CPAN also has some stuff
> * RFC 2617's predefined schemes, e.g.
>  ,
>  
>
> Principally the authn could also be put in the app layer instead of the Web
> server layer, but I prefer having it at the Web server because I can more
> easily share authn across apps.
>
> This being REST, Cookies are right out.
>
> The WSSE article is a bit dated. One fact is not true anymore, the crypto
> handshake has been extended to so that certificates do not need their own
> IP
> any more, i.e. many sites can indeed be hosted at the same server. This is
> why
> I bumped TLS to the top.
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] authentication

2011-03-12 Thread Peter Edwards
On 12 March 2011 19:41, shawn wilson  wrote:

> i am working on an app that allows users to access (and do some things)
> with email. however, i want a method of storing their password that would
> require them accessing the site in order for me to be able to decrypt. i was
> thinking of encrypting it based on the key that
> Catalyst::Plugin::Authentication uses to store credentials on their end. i
> also thought that maybe i could store some other field in that cookie that
> maybe had a seed.
>
> however, i was hoping that maybe someone would point out that this could be
> done totally internal to that authentication module or maybe another module
> does this? and maybe there's some sort of flaw in my ideas? or maybe someone
> on here has done something similar they'd be willing to share?
>
>
You haven't really given enough details of what you want to do for people to
be able to give a good and secure answer.
In general you need to create a token based upon a secure authentication
(like the way OAuth does) and use that.
However, it's not clear whether your token is passed in clear text or a
breakable session (in which case you need a one time key) or something else.
Of course email itself is insecure unless over SSL and even then a recorded
session could be broken in time.
Regards, Peter (with his black hat on)
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] authentication

2011-03-12 Thread shawn wilson
i am working on an app that allows users to access (and do some things) with
email. however, i want a method of storing their password that would require
them accessing the site in order for me to be able to decrypt. i was
thinking of encrypting it based on the key that
Catalyst::Plugin::Authentication uses to store credentials on their end. i
also thought that maybe i could store some other field in that cookie that
maybe had a seed.

however, i was hoping that maybe someone would point out that this could be
done totally internal to that authentication module or maybe another module
does this? and maybe there's some sort of flaw in my ideas? or maybe someone
on here has done something similar they'd be willing to share?
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Authentication with REST and Catalyst

2011-03-12 Thread Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯
If you think of cobbling together your own authentication scheme, don't. You 
will make mistakes and introduce weaknesses. Use the established ones, in 
decreasing order of preference:

* TLS, e.g.
  
* WSSE, e.g. , CPAN also has some stuff
* RFC 2617's predefined schemes, e.g.
  ,
  

Principally the authn could also be put in the app layer instead of the Web 
server layer, but I prefer having it at the Web server because I can more 
easily share authn across apps.

This being REST, Cookies are right out.

The WSSE article is a bit dated. One fact is not true anymore, the crypto 
handshake has been extended to so that certificates do not need their own IP 
any more, i.e. many sites can indeed be hosted at the same server. This is why 
I bumped TLS to the top.


signature.asc
Description: This is a digitally signed message part.
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Authentication with REST and Catalyst

2011-03-12 Thread linuxsupport
Thanks for but that is more on implementing authentication, I am looking for
authentication and authorization for REST API, I understand single key would
be better idea, but do we have any real example or guide line?

On Sat, Mar 12, 2011 at 1:36 AM, shawn wilson  wrote:

>
>
> On Fri, Mar 11, 2011 at 3:00 PM, Devin Austin wrote:
>
>>
>>
>> On Fri, Mar 11, 2011 at 12:48 PM, linuxsupport wrote:
>>
>>> Hi Everyone,
>>>
>>> What is the best practice for implementation authentication and
>>> authorization when building a REST API application using catalyst?
>>> How should authentication be implementation?
>>>
>>> Any guide or example would be very helpful.
>>>  Dev site: http://dev.catalyst.perl.org/
>>>
>>>
>> Probably an API key system.  It's much easier to maintain a single key
>> instead of having to pass a username/password each time you make a request
>> or what not.
>>
>>
>>
>> i found this useful:
> http://www.gossamer-threads.com/lists/catalyst/users/28136
> ... though i haven't implemented anything yet.
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Unicode::Encoding - utf8 "\xBA" does not map to Unicode

2011-03-12 Thread Bernhard Graf
Am 12.03.2011 11:35 schrieb Eisenberger Tamás:

> When you do utf8::decode, on a string form any input (file, http
> request, etc..) perl groups the two separate input bytes represented as
> two characters in the string "\xC3\xA9" into one utf8 character: "\xE9"
> and marks the string as utf8 (so utf8::is_utf8 returns 1).

Sorry, but that answer is complete nonsens and shows, where the main
problem for most developers is: They simply don't understand the
difference between Unicode and UTF-8.

Unicode describes a standard, that assigns a distinct code point to
every known character. Those code points are numbers from 0 to infinity
(in theory - of course we an eventual number of characters).

To store any information in a computer, it must be encoded, and that is
also true for Unicode code points. UTF-8 is such an encoding standard.

If you have an "é", which is assigned to Unicode code point 233 aka
\xE9, and you want to store that, then you have to encode it.
If you choose the UTF-8 encoding, the result is the two bytes "octet
stream" (16 bits) "\xC3\xA9". That is, what is stored in a file for
example, when you save "é" in UTF-8.

For certain reasons characters on Unicode code points 128..255 are the
same as in the common used iso-8859-1 encoding. That makes it sometimes
harder to decide, if some data is actually meant as UTF-8 - or is broken
unencoded Unicode data.

Back to the URL: When you have 'first_name=K%E9vyn' in an URL, the
meaning of %E9 is actually ambiguous, because there is no information
about the encoding. Fortunately RFC 3986 advises to encode all "reserved
characters" as UTF-8 before transforming them into the URI-percent
encoding, because percent encoding only works with bytes (octets). In
that sense, "K%E9vyn" is simply invalid, because "\xE9" alone is no
valid UTF-8 encoded character. What you have there is obviously the
percent encoding of the ISO-8859-1 encoding of "Kévyn". Therefore the
correct RFC 3986 compliant URI-encoding for "Kévyn" would be "K%C3%A9vyn".

HTH

Bernhard Graf

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


Re: [Catalyst] Unicode::Encoding - utf8 "\xBA" does not map to Unicode

2011-03-12 Thread Eisenberger Tamás
Sorry, you wrote that C::P::U::E fails to decode utf8, but not that it's
already decoded and your app fails..

This seems like some conflict between plugins, can you tell us what
plugins you use, with their versions, catalyst's version and the order
of plugins loaded? The order does matter in case of C::P::U::E because
it should be the first getting the input!
-- 
Eisenberger Tamás 

On Sat, 2011-03-12 at 11:32 +, Ryan Lauterbach wrote:
> > So utf8::is_utf8 means that the string has multiple bytes in one
> > character.
> > 
> > Of course $enc->decode() fails to decode the already decoded "\xE9"
> > again.
> > 
> > You can use that string without calling decode safely.
> > C::P::Unicode::Encoding will encode it before it gets written to the
> > output.
> > 
> 
> C::P::U::E is failing on decode straight from the url, before it gets to my  
> code, so this might be a bug somewhere along the pipeline. How has it been 
> decoded before it gets to c::p::u::e? Why is the is_UTF8 flag not set, thus 
> attempting to decode again?
> 
> Basically a UTF8 URL kills my app until I remove u::e.
> 
> Thanks
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/


smime.p7s
Description: S/MIME cryptographic signature
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Unicode::Encoding - utf8 "\xBA" does not map to Unicode

2011-03-12 Thread Andrew Rodland
On Friday, March 11, 2011 05:50:22 PM ryan lauterbach wrote:
> Hi,
> 
> I've read some threads about unicode, utf8 and query parameters but I
> don't understand it enough to fix on my own, so apologies for beating
> a dead horse.
> 
> When a URL contains a utf8 character in the query string such as
> ?first_name=K%E9vyn  (where %E9 is é, latin small e with acute),
> Unicode::Encoding barfs with  utf8 "\xE9" does not map to Unicode.

%E9 is not "a UTF-8 character". A properly encoded UTF-8 URL representation of 
'first_name=Kévyn' would be 'first_name=K%C3%A9vyn', which C::P::U::E will 
accept.

$ perl -MURI::Escape -Mutf8 -le 'my $str = "K\xe9vyn"; utf8::encode($str); 
print uri_escape($str)'
K%C3%A9vyn

Andrew

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


Re: [Catalyst] Unicode::Encoding - utf8 "\xBA" does not map to Unicode

2011-03-12 Thread Ryan Lauterbach

> So utf8::is_utf8 means that the string has multiple bytes in one
> character.
> 
> Of course $enc->decode() fails to decode the already decoded "\xE9"
> again.
> 
> You can use that string without calling decode safely.
> C::P::Unicode::Encoding will encode it before it gets written to the
> output.
> 

C::P::U::E is failing on decode straight from the url, before it gets to my  
code, so this might be a bug somewhere along the pipeline. How has it been 
decoded before it gets to c::p::u::e? Why is the is_UTF8 flag not set, thus 
attempting to decode again?

Basically a UTF8 URL kills my app until I remove u::e.

Thanks
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Unicode::Encoding - utf8 "\xBA" does not map to Unicode

2011-03-12 Thread Eisenberger Tamás
Hy!

You should read http://perldoc.perl.org/utf8.html for an explanation how
utf8 works in perl :)

In short:
When you do utf8::decode, on a string form any input (file, http
request, etc..) perl groups the two separate input bytes represented as
two characters in the string "\xC3\xA9" into one utf8 character: "\xE9"
and marks the string as utf8 (so utf8::is_utf8 returns 1).

So utf8::is_utf8 means that the string has multiple bytes in one
character.

Of course $enc->decode() fails to decode the already decoded "\xE9"
again.

You can use that string without calling decode safely.
C::P::Unicode::Encoding will encode it before it gets written to the
output.

If you want to output it to a file, you should call utf8::encode (or
$enc->encode()) on it before.

There is a good page explaining this on the catalyst wiki what is
currently down :( If I remember correctly, this is the proper link:
http://wiki.catalystframework.org/wiki/tutorialsandhowtos/using_unicode

-- 
Eisenberger Tamás 

On Fri, 2011-03-11 at 23:50 +, ryan lauterbach wrote:
> Hi,
> 
> I've read some threads about unicode, utf8 and query parameters but I
> don't understand it enough to fix on my own, so apologies for beating
> a dead horse.
> 
> When a URL contains a utf8 character in the query string such as
> ?first_name=K%E9vyn  (where %E9 is é, latin small e with acute),
> Unicode::Encoding barfs with  utf8 "\xE9" does not map to Unicode.
> 
> Now I believe \xE9 is Perl's internal representation of unicode, so it
> is already decoded by the time Unicode::Encoding::prepare_uploads is
> invoked.  However  Encode::is_utf8( $_ ) is not working or not
> appropriate in this instance and $enc->decode() then fails trying to
> decode \xE9.
> 
> I have removed Unicode::Encoding from my app for the time being.  It
> seems this is the base case for unicode in catalyst so I would think
> I'm doing something fundamentally wrong.  All modules are up to date
> as of tdoay.
> 
> Thanks for any help!
> 
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/


smime.p7s
Description: S/MIME cryptographic signature
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/