Skip to content

Commit

Permalink
Merge pull request #1024 from nyaruka/replace-nbrsp-gsm7
Browse files Browse the repository at this point in the history
Replace unicode non breaking spaces with a normal space in gms7
  • Loading branch information
nicpottier committed Jan 13, 2017
2 parents 45c4041 + 5c8b066 commit 3d248b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions temba/utils/gsm7.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
u'“': '"',
u'”': '"',
u'–': '-',
u'\xa0': ' ',
}


Expand Down
5 changes: 5 additions & 0 deletions temba/utils/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,11 @@ def test_is_gsm7(self):
self.assertEquals('No crazy "word" quotes.', replaced)
self.assertTrue(is_gsm7(replaced))

# non breaking space
replaced = replace_non_gsm7_accents("Pour chercher du boulot, comment fais-tu ?")
self.assertEquals('Pour chercher du boulot, comment fais-tu ?', replaced)
self.assertTrue(is_gsm7(replaced))


class ChunkTest(TembaTest):

Expand Down

0 comments on commit 3d248b4

Please sign in to comment.