summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-02-24 21:07:15 +0100
committerwm4 <wm4@nowhere>2014-02-24 22:50:24 +0100
commit38a36fd7ea4a4d9bd4f8ea659f846b7d8784e27b (patch)
treed054f39bf2c6d17ead0a85ee61cc9497d2f63c2e
parentf628d5e8592b774132565ab153a8464c8d83548b (diff)
downloadmpv-38a36fd7ea4a4d9bd4f8ea659f846b7d8784e27b.tar.bz2
mpv-38a36fd7ea4a4d9bd4f8ea659f846b7d8784e27b.tar.xz
client API: add comment about character encoding issues
Also mention that NULL isn't valid. Although I'm not sure whether the implementation strictly follows this (it should, but there are some wacky corner cases).
-rw-r--r--libmpv/client.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/libmpv/client.h b/libmpv/client.h
index d94c129c74..462ff3a9bd 100644
--- a/libmpv/client.h
+++ b/libmpv/client.h
@@ -364,6 +364,14 @@ typedef enum mpv_format {
* The basic type is char*. It returns the raw property string, like
* using ${=property} in input.conf (see input.rst).
*
+ * NULL isn't an allowed value.
+ *
+ * Warning: although the encoding is usually UTF-8, this is not always the
+ * case. File tags often store strings in some legacy codepage,
+ * and even filenames don't necessarily have to be in UTF-8 (at
+ * least on Linux). If you pass the strings to code that requires
+ * valid UTF-8, you have to sanitize it in some way.
+ *
* Example for reading:
*
* char *result = NULL;
@@ -665,6 +673,8 @@ int mpv_get_property(mpv_handle *ctx, const char *name, mpv_format format,
* Return the value of the property with the given name as string. This is
* equivalent to mpv_get_property() with MPV_FORMAT_STRING.
*
+ * See MPV_FORMAT_STRING for character encoding issues.
+ *
* On error, NULL is returned. Use mpv_get_property() if you want fine-grained
* error reporting.
*