IRC channel logs

2018-02-12.log

back to list of logs

<rlb>Is there any current plan with respect to handling binary paths, usernames, groups, xattrs, acls? i.e. guile treats them as strings right now, but they're not necessarily, and in the general case, there's no way to know the encoding.
<rlb>(...important for any tool trying to preserve the original bytes from readdir(), getpwent() etc. -- like, say a backup/restore tool)
<rlb>Offhand, I'd imagine that guile either needs new apis that return the unmodified data, or (less desirably) some hack like python's surrogateescape.
<lloda>guile-cairo users here? I need an example of using cairo-image-surface-get-data
<lloda>ok, found a bug :-/
<lloda>the vu8/u8 split is irritating
<spk121>rlb: if you need binary paths, you can set the locale to an iso88591, which will not throw an encoding exception. Since there is inherently no way to visualize binary paths as strings, using a latin 1 visualization is as good as anything.
<rlb>spk121: however it happens, I need the exact bytes returned by the underlying system calls, i.e. guaranteed not to have been altered by say unicode normalization, etc. And preferably without any extra allocation/overhead.
<spk121>rlb: then iso88591 is the way to go. binary bytes 0 to 255 map to iso-8859-1 values 0 to 255 map to unicode codepoints 0 to 255. The guile string representation, since it has codepoints guaranteed to be less that 256, will always be "narrow" strings.
<spk121>rlb: I realize that is isn't what you really want, which is some sort of flag on string-like data that declares it truly binary, but, it might suffice
<spk121>as far as I know, guile strings' unicode normalization never changes except when explicitly requested
<rlb>Thanks - I'd be fine with a different type too (u8vec), etc., just something that presents the real api/data. And of course if I decide to pursue this, I could just write my own wrappers if that ended up seeming preferable, but if were to do that, I'd probably want to see if I could do something more generally useful.
<rlb>In the long run, I think guile should probably provide direct access -- fwiw, after a bit of poking around it looks like python attempted to address this issue via surrogateescape, and rust provides a separate OsString type.
<rlb>(the latter of course isn't necessarily compatible with unicode or anything else)
<rlb>(just bytes)