text-shadow: 0 0 20px #333;
padding: 2px 5px;
}
+ .indexlink {
+ position: absolute;
+ bottom: 1em;
+ left: 1em;
+ }
</style>
</head>
<body>
---
+layout: true
+
+.indexlink[[Index](index.html)]
+
+---
+
# Enciphering and deciphering
## Arithmetic on letters
---
-# Accents
-
-```python
->>> caesar_encipher_letter('é', 1)
-```
-What does it produce?
-
-What should it produce?
-
-## Unicode, combining codepoints, and normal forms
-
-Text encodings will bite you when you least expect it.
-
-* urlencoding is the other pain point.
-
----
-
-# Five minutes on StackOverflow later...
-
-```python
-def unaccent(text):
- """Remove all accents from letters.
- It does this by converting the unicode string to decomposed compatibility
- form, dropping all the combining accents, then re-encoding the bytes.
-
- >>> unaccent('hello')
- 'hello'
- >>> unaccent('HELLO')
- 'HELLO'
- >>> unaccent('héllo')
- 'hello'
- >>> unaccent('héllö')
- 'hello'
- >>> unaccent('HÉLLÖ')
- 'HELLO'
- """
- return unicodedata.normalize('NFKD', text).\
- encode('ascii', 'ignore').\
- decode('utf-8')
-```
-
----
-
# Doing all the letters
## Test-first developement