skip to main
|
skip to sidebar
The Secret Life of Bears
Python, MySQL and Your Mom
Sunday, December 7, 2008
See how python encodes a string internally
Fun fact: you can see how python encodes a string internally by asking it to encode a unicode object to the 'unicode_internal' codec.
Example:
>>> u'\N{SNOWMAN}'.encode('utf16')
'\xfe\xff&\x03'
>>> u'\N{SNOWMAN}'.encode('unicode_internal')
'&\x03'
As you can see, it's UTF16 without a BOM.
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
What is this blog about?
As I learn something about mysql or python (or perhaps something else) I blog about it.
This allows me to 1) lock the new knowledge into my brain more completely 2) share this knowledge with others asynchronously.
Links
My beautiful creation
Lunch money
Important message from our sponsor
Study this
Blogroll
Statistical Modeling, Causal Inference, and Social Science
Election prediction markets: What happens next?
3 hours ago
Boing Boing
Tech's best sidekick — this USB-c hub stand is just $139.99
7 hours ago
Simon Willison's Weblog
Oracle, it’s time to free JavaScript.
7 hours ago
Scripting News
13 hours ago
MySQL Performance Blog
MySQL 8.0 vs. 5.7: Are the Newer Versions More Problematic?
16 hours ago
Language Log
How to say "AI" in Mandarin
18 hours ago
xkcd.com
Every Scientific Field
1 day ago
Opinions, Expertise, Passion.
RDS MySQL Aurora 3.07.0 is unusable for upgrades
2 months ago
Google Research Blog
Generative AI to quantify uncertainty in weather forecasting
5 months ago
The Secret Life of Beers
11 months ago
Matt Cutts: Gadgets, Google, and SEO
Twins!!
1 year ago
Machine Learning (Theory)
An AI Miracle Malcontent
1 year ago
Overcoming Bias
Only Physics Computes
1 year ago
Predictably / Irrational
Ask Ariely: On Remixing Referrals and Editing Expectations
2 years ago
BlogRevolution!
20% Dyson coupon | eBay. Shop direct from the brand and save.
3 years ago
Matthew Yglesias
Search
4 years ago
Xaprb
VividCortex Is Joining SolarWinds!
4 years ago
natural language processing blog
Yet another list of things we can do to have more diverse sets of invited speakers
6 years ago
Pythian Group Blog
My Internship Experience at Pythian
6 years ago
rc3.org
Hacked By SA3D HaCk3D
7 years ago
Delicious/tag/python
Sponsored: 64% off Code Black Drone with HD Camera
8 years ago
Delicious/tag/bayes
Sponsored: The 3 Week Diet
8 years ago
Julian Sanchez
A CryptoFiction
9 years ago
Patrick Galbraith
DBD::mysql 4.026 released
10 years ago
kiwitobes.com
Tuxedo Jacket
10 years ago
Jeremy Zawodny's blog
I'm Blogging Elsewhere
14 years ago
Algorithm Analysis
BellKor Algorithm: Pearson Correlation Coefficient
16 years ago
Jay Pipes
The Arctic Dolphin
Planet Drizzle
Made to Stick
Python News
unofficial planet python
Blog Archive
►
2009
(28)
►
June
(1)
►
May
(4)
►
March
(10)
►
February
(8)
►
January
(5)
▼
2008
(77)
▼
December
(17)
Mysql sounds like operator
Put last word in quotes
Fix up screen good
make python understand ~ for home directories
any and all
Commands that can see themselves
The different permutations of grep
commandline fun tr and seq
Parse any date easily
How to swap two tables without downtime
See how python compiles some code
See how python encodes a string internally
Fun stuff with unicode in python
Use vim's multiple paste buffers
Hash images
Keep a series of python objects in a shelf
Tell whether two clients are using the same connec...
►
November
(35)
►
October
(25)
Labels
python
(42)
mysql
(27)
unix
(19)
opensql camp
(5)
vim
(3)
distractions
(2)
regex
(2)
php
(1)
unicode
(1)
Science compels us to act, act now, these low interest rates won't last!
No comments:
Post a Comment