| === Pendulum_ is now known as Pendulum | ||
| === daxroc_ is now known as daxroc | ||
| czajkowski | aloha | 13:39 |
|---|---|---|
| slashtom | hello! | 13:41 |
| dumb1224 | hi~~ | 13:48 |
| ebel | hi | 13:55 |
| czajkowski | hows folks | 13:59 |
| dumb1224 | doing ok... | 14:03 |
| czajkowski | good good | 14:06 |
| dumb1224 | have a question, pipe '|' doesn't handle unicode char? | 14:41 |
| ebel | what do you mean? | 14:42 |
| dumb1224 | I used python to print out some charactors, some contain unicode char, | 14:44 |
| dumb1224 | then I used > to save the output stream as a file | 14:44 |
| dumb1224 | when I run the python code it prints on the console without problem, | 14:45 |
| dumb1224 | but when I used > I get a UnicodeEncodeError exception | 14:46 |
| ebel | | should pass data around as is, doesn't touch it. | 14:46 |
| ebel | sounds like a python problem. what's the exact unicodeencodeerror message? | 14:47 |
| dumb1224 | UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 96: ordinal not in range(128) | 14:47 |
| ebel | sounds like python wants to print it out, but it doesn't know how to encode the characters, so it can't print it out. | 14:48 |
| dumb1224 | hmmm | 14:49 |
| ebel | i can get the same error. | 14:49 |
| dumb1224 | so I better save the stream as it is? | 14:50 |
| ebel | My *guess* is that python is able to tell the difference between outputting to a file and outputting to a terminal | 14:50 |
| ebel | and knows the output encoding of the terminal, so can print it, but there is no such thing as the encoding of a file (sort of) | 14:50 |
| ebel | To fix it, you need to decide what encoding to use (utf-8 is the most common) | 14:51 |
| ebel | and change your python script to be like -> print STRING.encode("ENCODING") | 14:51 |
| dumb1224 | and which object do I call to get the encode() method?I'm quite a newbie to python :D | 14:53 |
| ebel | You'd call it on the string object. | 14:54 |
| ebel | so like this: | 14:54 |
| ebel | print "foobar\u2019".encode("utf8") | 14:54 |
| ebel | actually that's wrong | 14:56 |
| ebel | it should be: | 14:56 |
| ebel | print u"foobar\u2019".encode("utf8") | 14:56 |
| ebel | so if you have a string called 'text', i.e. you used to do "print text", you would now do "print text.encode("utf8")" | 14:56 |
| dumb1224 | it worked!thanks! | 14:58 |
| ebel | no problem | 14:59 |
| airurando | evening | 18:52 |
| airurando | anone about for the monthly meeting? | 18:57 |
| * airurando watched the tumbleweed drift through the #ubuntuie channel | 18:59 | |
| airurando | hmmmmm............ | 19:06 |
| czajkowski | :( | 19:06 |
| czajkowski | kinda goind down hill isn;t it | 19:06 |
| airurando | I guess the meeting is cancelled | 19:06 |
| airurando | czajkowski howdy | 19:06 |
| airurando | seems that way unfortunately :( | 19:07 |
| czajkowski | airurando: hows things | 19:07 |
| airurando | good now. | 19:07 |
| czajkowski | airurando: mye the date/time needs looking at or something or asking people wny they don't want to interact ? | 19:07 |
| airurando | busted a gut getting through the ploughing championship traffic to get home for this | 19:08 |
| airurando | frustrating | 19:08 |
| czajkowski | :( | 19:08 |
| czajkowski | *hugs* | 19:08 |
| airurando | aye we'll have to re-evaluate | 19:08 |
| czajkowski | know how you feel | 19:08 |
| airurando | not to worry. | 19:08 |
| czajkowski | maybe a mail to the lsit saying people giving up time to help promote open source - Ubuntu everyone kinda needs to step up a bit | 19:08 |
| airurando | aye. | 19:09 |
| airurando | I'll try to chat to ebel about it | 19:09 |
| airurando | Oisin is 6 tomorrow :) | 19:10 |
| czajkowski | wow | 19:10 |
| airurando | time flies | 19:11 |
| * airurando has to work tomorrow :( | 19:11 | |
| airurando | I'mm off. Will put the kids to bed instead. | 19:15 |
| airurando | That's more fun anyway ;) | 19:15 |
| slashtom | oh we missed the meeting... sorry, we were swimming then eating | 20:39 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!