On Tue, Feb 21, 2023 at 04:10:53PM +0100, Ede Wolf wrote:
The same way you would enter Unicode in any other application. This is not an LDAP- or LDIF-specific question.
- use a terminal and locale that support UTF-8.
- use whatever tools your OS provides for entering Unicode
characters. Probably something named "Unicode character map" or similar.
Thanks again. But my question regards the values for attributes.
Having a ldif file, for the dn I can enter: dn: cn=A \F0\9F\99\82 Test,dc=example,dc=com
That would literally give me the utf8 smiley icon as part of my dn - provided my font feratures that, of course. So I can use the hex encoding representation to enter any UTF-8 character.
I can even search for that icon, using that hex encoding as search base or part of the search filter.
However, for a value, I cannot do this, and my question is, is there a way at all? This has nothing to do with my console.
For a directorystring attribute (it value), is there any way of entering code points straight into my ldif - be it U+0000 or hex notation - and having the server interpret them, as it works for the dn?
Not copy+paste from the command line, but, again, as encodigs where the ldap server knows, these are to be interpreted. As it does for the dn.
Something like: cn: A \F0\9F\99\82 Test
Just with a syntax that works. If that it possible at all.
Hi Ede, in a search filter you are dealing with RFC 4515 which describes how to escape values into that string, similar with URIs, which have their own escaping rules you can leverage for this. With LDIF, you are dealing with RFC 2849 which has no concept of escaping values: you can enter a value as-is, base64 encoded or pass it from a separate file/URI but that's it.
The client doesn't do any processing of the ldif data (unlike URLs, or filters, as discussed above) and will pass it on as it sees it, so it will send the text 'cn=A \F0\9F\99\82 Test,dc=example,dc=com' as DN. It is up to the server (and the attribute's syntax) to decide what happens with whatever you've input. In the case of DNs, sending 'cn=A \F0\9F\99\82 Test,dc=example,dc=com' is then (server-side) considered equivalent to you specifying 'cn=a 🙂 test , dc=EXAMPLE, dc=cOm' as per RFC 4514.
Regards,