aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'youtube/util.py')
-rw-r--r--youtube/util.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/youtube/util.py b/youtube/util.py
index e92fed5..3d5546a 100644
--- a/youtube/util.py
+++ b/youtube/util.py
@@ -601,3 +601,9 @@ def to_valid_filename(name):
name = '_' + name
return name
+
+
+def strip_non_ascii(string):
+ ''' Returns the string without non ASCII characters'''
+ stripped = (c for c in string if 0 < ord(c) < 127)
+ return ''.join(stripped)