Welcome to NYCU CSIT Mirror site
Encoding utils: libblkid Reference Manual
Encoding utils
Encoding utils — encode strings to safe udev-compatible formats
|
|
Functions
blkid_encode_string ()
int
blkid_encode_string (const char *str
,
char *str_enc
,
size_t len
);
Encode all potentially unsafe characters of a string to the
corresponding hex value prefixed by '\x'.
Returns
0 if the entire string was copied, non-zero otherwise.
blkid_safe_string ()
int
blkid_safe_string (const char *str
,
char *str_safe
,
size_t len
);
Allows plain ascii, hex-escaping and valid utf8. Replaces all whitespaces
with '_'.
Returns
0 on success or -1 in case of error.