@@ -139,7 +139,7 @@ null-terminated UTF-8 encoded string.
140### Error recovery
140### Error recovery
142−It is sometimes desireable to recover from errors when decoding strings
142+It is sometimes desirable to recover from errors when decoding strings
143that are supposed to be UTF-8 encoded. Programmers should be aware that
143that are supposed to be UTF-8 encoded. Programmers should be aware that
144this can negatively affect the security properties of their application.
144this can negatively affect the security properties of their application.
145A common recovery method is to replace malformed sequences with a
145A common recovery method is to replace malformed sequences with a
@@ -155,8 +155,8 @@ aswell.
156The following code implements one such recovery strategy. When an
156The following code implements one such recovery strategy. When an
157unexpected byte is encountered, the sequence up to that point will be
157unexpected byte is encountered, the sequence up to that point will be
158−replaced and, if the error occured in the middle of a sequence, will
158+replaced and, if the error occurred in the middle of a sequence, will
159−retry the byte as if it occured at the beginning of a string. Note that
159+retry the byte as if it occurred at the beginning of a string. Note that
160the decode function detects errors as early as possible, so the sequence
160the decode function detects errors as early as possible, so the sequence
161`0xED 0xA0 0x80` would result in three replacement characters.
161`0xED 0xA0 0x80` would result in three replacement characters.