Skip to content

Commit ca18ae0

Browse files
committed
Initial helperfunc module
Add a helperfunc module to the package to provide common helper functions that are used by multiple modules in the package.
1 parent f075d0f commit ca18ae0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ciscosparkapi/helperfunc.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"""Package helper functions."""
2+
3+
4+
def utf8(string):
5+
"""Return the 'string' as a UTF-8 unicode encoded string."""
6+
assert isinstance(string, basestring)
7+
if isinstance(string, unicode):
8+
return string
9+
elif isinstance(string, str):
10+
return unicode(string, encoding='utf-8')

0 commit comments

Comments
 (0)