<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Unicode on Shai Asher</title><link>https://slow-is-smooth.io/tags/unicode/</link><description>Recent content in Unicode on Shai Asher</description><generator>Hugo</generator><language>en-gb</language><lastBuildDate>Sun, 17 Feb 2019 09:00:00 +0200</lastBuildDate><atom:link href="https://slow-is-smooth.io/tags/unicode/index.xml" rel="self" type="application/rss+xml"/><item><title>Strings That Change Width</title><link>https://slow-is-smooth.io/blog/strings-that-change-width/</link><pubDate>Sun, 17 Feb 2019 09:00:00 +0200</pubDate><guid>https://slow-is-smooth.io/blog/strings-that-change-width/</guid><description>&lt;p&gt;A megabyte of ASCII log text in Python 3.7 is a 1,000,049-byte object. Append one snake emoji to it&#10;and the result is 4,000,080 bytes, nearly four times as much memory for one more character, because&#10;every character in the new string, all million of them, is now stored in four bytes. That is not a&#10;quirk of a particular operation. It&amp;rsquo;s how CPython has stored strings since Python 3.3: each string&#10;picks the narrowest fixed width that fits its widest character, and one character is enough to widen&#10;all the others.&lt;/p&gt;</description></item></channel></rss>