Getting Python's encoding and decoding straight
Because I have recently been confusing myself with this, and because itis not clearly documented in the Python standard library or the tutorial(at least not that I could spot):
.decode()decodes a plain string (ie, bytes in some encoding) toa Unicode string..encode()encodes a Unicode string into a plain string.
Feeding a plain string to the unicode() constructor is the same ascalling .decode() on the string.
Things get weird if you call .encode
流感中招
托美兒的福
美兒大壽,與其偶像(又稱契爺)馬家輝先生吃飯,托美兒的福,輾轉終於得到傳說中的偶像

How to force a crash dump on Solaris 10 x86
Because SPARCs have OpenBoot, forcing Solaris SPARC to panic and do acrash dump is generally a pretty simple process. Because x86 hardwarehas no PROM environment (despite Sun trying to pretend otherwise ), forcing a crash dump on Solaris 10 x86 is alittle bit more intricate.
Crash dumps are done through the kernel debugger, which has to be loadedahead of time from and on the system console. (Technically I think thatyou can load it on a serial connection, should you have one
當連卡佛遇上金融海嘯
Cripple
I couldn't open the tax computation message from the Inland Revenue Department. Interim report form for my research project could not be completed. I had no way to send out the reference letter for my intern. It was impossible for me to read the new issue of the New England Journal of
海角七號
我看的時候
老是在想
台灣人為什麼不選擇楊德昌的"一一"
而是選了這一齣
" 海角七號 "其實好看
有愛情有親情有歷史情意結有社會現況
當然更重要的是這是一個關於愛與夢的故事
電影明顯受日本電
What the members of a Unicode conversion error object are
The codecs module 's register_error function has a rather scanty description of whaterror handlers are called with. Since I have just dug into this,here is what the members are for at least UnicodeDecodeError:
object | The string that is being decoded to Unicode. |
encoding | The encoding that the string is (theoretically) in. |
start | The index in object of the first character that could not be decoded. |
end | One past the end character of this decodingproblem. |
reason | The human-readable error text. |
The substring object