@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40



Comments:

<0> i tried to put use encoding qw/utf-8/; in my script but it made it even worse :P
<1> evenin' Yaakov
<2> janhaa, do you want to convert %C3%B8 back into utf8 (i.e. back into 2 bytes)?
<0> avataar, to be hones i'm not sure which charset it is - but i want it to become utf-8
<0> how did you write that without making it get all messed up with colors?
<2> you need to get rid of the escaped representation first.. have a look at the URI::Escape module, ure_unescape to be more specific
<2> or you can do it with a regexp
<3> janhaa: In utf8, that sequence corresponds to the character . Is that what you expect?
<3> (that is, an o with a stroke through it)
<0> Ciaran_H, yeah. i would like it to be "", but instead it's "\xc3\xb8%" in my script
<2> janhaa, you can write %% to get % in xchat
<0> avataar, i would rather tell apache/mod_perl that it's utf-8 right away, instead of going through another module
<0> avataar, thanks. i'll remember that
<2> janhaa, it's not about utf8 or not, it's escaped
<2> see URI::Escape as i said
<0> avataar, but something is messed up, since it should get "un-escaped" by it self.



<3> janhaa: The string sequence "%C3%B8" is 6 bytes. You want to convert it into 2 bytes first, so you need to unescape it.
<2> and it seems to be utf8 already
<3> janhaa: It's obviously been encoded needlessly somewhere, then.
<2> not needlessly if p***ed over via GET
<0> Ciaran_H, that might be. could that "somewhere" be in my browser?
<3> janhaa: Unlikely.
<2> very likely in your browser
<3> It's much more likely that you have a form hidden element something like <input type=hidden name="something" value="%C3%B8">.
<0> http://paste.flodhest.net/1144755058.html # could you check this out?
<2> janhaa, are you using POST or GET?
<0> Ciaran_H / avataar, likely or unlikely? :)
<2> likely if you're using GET
<2> unlikely if POST
<0> avataar, check the linke - i'm using GET
<2> then either use POST or unescape your data with URI::Escape
<0> strange that it's the only way :/
<0> same result with POST.
<3> janhaa: I don't understand the problem. When I submit that form, the URL it comes up with has it properly escaped. The actual result is a 404, but as long as you use something like the CGI module and the param() query, it should all be handled for you.
<2> or instead use $string =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
<2> if you don't want to use the module
<3> Don't try to reinvent the wheel by parsing the URL yourself.
<4> ~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex($1))/eg;
<2> eval: $string = '%C3%B8'; $string =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; $string
<5> avataar: Return:
<1> shoot, use /i and collapse A-Da-f to a-f while you're at it
<4> eval: $string = '%C3%B8'; $string =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex($1))/eg; $string
<5> damir: Return:
<0> Ciaran_H, i also thought the module (Apache2::Request) should do the work for me...
<3> janhaa: Oh, you're using mod_perl?
<0> yeah :)
<3> Hmm. I don't know anything about that.
<2> janhaa, just accept it works in a different way than you thought
<0> Ciaran_H, i'm posting some data to a mod_perl 2.0 powered apache server. the data contains "%C3%B8", but is not translated into an utf-8 character.
<0> :)
<0> avataar, i got a hard time accepting this :-P
<2> janhaa, er du norsk eller dansk forresten? :)
<0> norwegian
<4> han er dansk
<0> who is danish?
<2> hehe
<4> du skal vaere dansk :-)
<0> and why couldn't i be swedish? :-P
<4> for du er s dum i huved
<2> you would've had if you were swedish
<4> (:
<4> ?
<0> avataar, true indeed :)
<3> janhaa: Sorry I can't help. As I said, I don't know about mod_perl. The only thing I can say is that if it turns out that it doesn't do that - and that seems to be the case here - go ahead and use uri_unescape.
<3> Because the browser is encoding it correctly.
<0> i'll bug MrGoogle some more... i'm obsessed with this issue :/
<2> janhaa, use that regexp, it should fix your prob.. but i still recommend reading the docs of URI::Escape
<4> you dont need stinking URI::Escape to do one regex work
<3> janhaa: If you prefer, you could try the unescape_url() function in Apache2::URI.
<3> http://search.cpan.org/dist/mod_perl/docs/api/Apache2/URI.pod
<0> avataar, i don't like the solution. it sounds like a pretty dumb way to fix the issue. so i need to be absolutely sure there's no other way...
<2> janhaa, use POST then
<0> avataar, it doesn't matter weither i use POST or GET
<4> he wants to fix the problem, not to avoid it
<3> avataar: Using POST won't make a difference.
<2> no escaping is supposed to happen there



<2> no data through an URI
<3> avataar: No, escaping *does* happen in a POST.
<3> It always has done.
<3> avataar: Try sniffing a POST request sometime. You'll see it posts in almost exactly the same format as a GET does. That is, param1=some+text&param2=some+%22other+text%22
<3> avataar: If you're curious, I just sniffed it for you. http://matrix.theblob.org/post-request.txt
<2> ok, agreed, but that's if you submit your stuff with Content-Type: application/x-www-form-urlencoded
<2> there's also multipart/form-data
<3> Well, yes. That would do it in a binary fashion.
<3> But that would be an extremely ugly hack.
<2> yeah, he can just unescape
<6> WTF doesnt this work?
<6> http://pastebin.com/653280
<7> The paste 653280 has been moved to http://erxz.com/pb/958
<8> doesn't work?
<6> 500 Internal Server error,i just copied it from the CGI.pm docu
<6> it did work yesterday o_O
<8> mc__: http://www.perl.com/doc/FAQs/cgi/idiots-guide.html
<6> i did write exactly what the problem is
<9> lo
<6> apache is set up correctly
<9> maybe someone can help me wiht HTML::Parser ?
<8> mc__: If you knew exactly what the problem was, you'd be able to fix it.
<9> with*
<8> mc__: "500" says nothing, except "doesn't work"
<8> mc__: Go read the page, and find out what's wrong.
<0> i figured out the problem - apache was working in iso-8859 mode, so i just changed it into utf-8, and voila! :)
<8> mc__: You could refuse, but why refuse help after asking for it?
<0> Ciaran_H / avataar ^
<2> :)
<9> i need HTML::Parser version 3.33 at least. 3.34 and up fail when doing make. have someone had a similar problem?
<6> Juerd: i read it ,but it didnt help me
<8> mc__: So, what was in the error log?
<10> mc__: what happened when you ran it interactively?
<11> When the add copy says, "New and Improved Fart Machine" it is time to close the browser.
<11> ad
<8> afk
<11> (It is going to be one of those days, I can sense it.)
<12> trust your feelings.
<13> Yaakov - I just had one of those days. It ****ed. :(
<6> mauke:
<6> http://pastebin.com/653291
<7> The paste 653291 has been moved to http://erxz.com/pb/959
<6> with use strict;
<9> exit
<10> mc__: what's in the error log?
<6> mauke: i'm looking for it
<14> And now for something completely different...
<15> A man.. with a tape recorder in his nose.
<6> mauke: ehm ,i think there is no error log
<6> oh sorry i found it
<6> [Tue Apr 11 13:14:28 2006] [error] [client 127.0.0.1] Premature end of script headers: /usr/local/www/cgi-bin/cgi
<10> weird
<14> Don't suppose anyone here knows much about FLV files
<11> SHUT UP
<14> Yaakov, I PREFER TO SHUT DOWN THANK YOU
<16> it's orangelicious!
<3> $ shutdown -h now
<17> GumbyBRAIN: oranges.
<18> resiak: Venus:~ rutski89$ perldoc -f while.
<11> Thanks but you eat it.
<14> how the crrrrrrrraap do you get duration from an flv
<14> ffmpeg/mplayer all return -2342424234234234234 seconds :p
<11> Play it, time how long it takes.
<16> google tells me some flv files don't *HAVE* metadata )
<10> mc__: what happens when you insert 'use CGI::Carp qw(fatalsToBrowser);' in line 2?
<11> Some .flv files OOZE HATE.
<14> Botje, yeah, I read about that, but I'm converting to 1.1's which *should*
<14> I s'pose I could just grep it during the initial conversion
<16> you could divide the filesize by the bitrate
<16> that's a fair estimate
<19> time mplayer vid.flv already
<11> q[ender]: beloved Andi


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #perl
or
Go to some related logs:

sudo chown -R enemy territory
#gentoo
winetools dapper libgtk
#javascript
vim omnicomplete PHP
#oe
reiserfs_create_journal error: cannot create a journal
mpt-status sources-list
#fedora
ubuntu.avi



Home  |  disclaimer  |  contact  |  submit quotes