aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pyexiv2.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pyexiv2.py b/src/pyexiv2.py
index 2c49db9..2cda133 100644
--- a/src/pyexiv2.py
+++ b/src/pyexiv2.py
@@ -543,6 +543,17 @@ class IptcTag(MetadataTag):
else:
raise IptcValueError(value, xtype)
+ elif xtype == 'String':
+ if type(value) is unicode:
+ try:
+ return value.encode('utf-8')
+ except UnicodeEncodeError:
+ raise IptcValueError(value, xtype)
+ elif type(value) is str:
+ return value
+ else:
+ raise IptcValueError(value, xtype)
+
# TODO: other types
raise IptcValueError(value, xtype)