chiark / gitweb /
Loosen playlist command rights.
[disorder] / doc / disorder_protocol.5.in
1 .\"
2 .\" Copyright (C) 2004-2008 Richard Kettlewell
3 .\"
4 .\" This program is free software; you can redistribute it and/or modify
5 .\" it under the terms of the GNU General Public License as published by
6 .\" the Free Software Foundation; either version 2 of the License, or
7 .\" (at your option) any later version.
8 .\"
9 .\" This program is distributed in the hope that it will be useful, but
10 .\" WITHOUT ANY WARRANTY; without even the implied warranty of
11 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 .\" General Public License for more details.
13 .\"
14 .\" You should have received a copy of the GNU General Public License
15 .\" along with this program; if not, write to the Free Software
16 .\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17 .\" USA
18 .\"
19 .TH disorder_protocol 5
20 .SH NAME
21 disorder_protocol \- DisOrder communication protocol
22 .SH DESCRIPTION
23 The DisOrder client and server communicate via the protocol described
24 in this man page.
25 .PP
26 The protocol is liable to change without notice.
27 You are recommended to check the implementation before believing this document.
28 .SH "GENERAL SYNTAX"
29 Everything is encoded using UTF-8.
30 See
31 .B "CHARACTER ENCODING"
32 below for more detail on character encoding issues.
33 .PP
34 Commands and responses consist of a line perhaps followed (depending on the
35 command or response) by a body.
36 .PP
37 The line syntax is the same as described in \fBdisorder_config\fR(5) except
38 that comments are prohibited.
39 .PP
40 Bodies borrow their syntax from RFC821; they consist of zero or more ordinary
41 lines, with any initial full stop doubled up, and are terminated by a line
42 consisting of a full stop and a line feed.
43 .PP
44 Commands only have a body if explicitly stated below.
45 If they do have a body then the body should always be sent immediately;
46 unlike (for instance) the SMTP "DATA" command there is no intermediate step
47 where the server asks for the body to be sent.
48 .PP
49 Replies also only have a body if stated below.
50 The presence of a reply body can always be inferred from the response code;
51 if the last digit is a 3 then a body is present, otherwise it is not.
52 .SH COMMANDS
53 Commands always have a command name as the first field of the line; responses
54 always have a 3-digit response code as the first field.
55 See below for more details about this field.
56 .PP
57 All commands require the connection to have been already authenticated unless
58 stated otherwise.
59 If not stated otherwise, the \fBread\fR right is sufficient to execute
60 the command.
61 .TP
62 .B adduser \fIUSERNAME PASSWORD \fR[\fIRIGHTS\fR]
63 Create a new user with the given username and password.
64 The new user's rights list can be specified; if it is not
65 then the \fBdefault_rights\fR setting applies instead.
66 Requires the \fBadmin\fR right, and only works on local
67 connections.
68 .TP
69 .B allfiles \fIDIRECTORY\fR [\fIREGEXP\fR]
70 List all the files and directories in \fIDIRECTORY\fR in a response body.
71 If \fIREGEXP\fR is present only matching files and directories are returned.
72 .TP
73 .B confirm \fICONFIRMATION
74 Confirm user registration.
75 \fICONFIRMATION\fR is as returned from \fBregister\fR below.
76 This command can be used without logging in.
77 .TP
78 .B cookie \fICOOKIE
79 Log a user back in using a cookie created with \fBmake\-cookie\fR.
80 The response contains the username.
81 .TP
82 .B deluser \fIUSERNAME
83 Delete the named user.
84 Requires the \fBadmin\fR right, and only works on local connections.
85 .TP
86 .B dirs \fIDIRECTORY\fR [\fIREGEXP\fR]
87 List all the directories in \fIDIRECTORY\fR in a response body.
88 If \fIREGEXP\fR is present only matching directories are returned.
89 .TP
90 .B disable \fR[\fBnow\fR]
91 Disable further playing.
92 If the optional \fBnow\fR argument is present then the current track
93 is stopped.
94 Requires the \fBglobal prefs\fR right.
95 .TP
96 .B edituser \fIUSERNAME PROPERTY VALUE
97 Set a user property.
98 With the \fBadmin\fR right any username and property may be specified.
99 Otherwise the \fBuserinfo\fR right is required and only the
100 \fBemail\fR and \fBpassword\fR properties may be set.
101 .IP
102 User properties are syntax-checked before setting.  For instance \fBemail\fR
103 must contain an "@" sign or you will get an error.  (Setting an empty value for
104 \fBemail\fR is allowed and removes the property.)
105 .TP
106 .B enable
107 Re-enable further playing, and is the opposite of \fBdisable\fR.
108 Requires the \fBglobal prefs\fR right.
109 .TP
110 .B enabled
111 Report whether playing is enabled.
112 The second field of the response line will be \fByes\fR or \fBno\fR.
113 .TP
114 .B exists \fITRACK\fR
115 Report whether the named track exists.
116 The second field of the response line will be \fByes\fR or \fBno\fR.
117 .TP
118 .B files \fIDIRECTORY\fR [\fIREGEXP\fR]
119 List all the files in \fIDIRECTORY\fR in a response body.
120 If \fIREGEXP\fR is present only matching files are returned.
121 .TP
122 .B get \fITRACK\fR \fIPREF\fR
123 Getsa preference value.
124 On success the second field of the response line will have the value.
125 .IP
126 If the track or preference do not exist then the response code is 555.
127 .TP
128 .B get\-global \fIKEY\fR
129 Get a global preference.
130 .IP
131 If the preference does not exist then the response code is 555.
132 .TP
133 .B length \fITRACK\fR
134 Get the length of the track in seconds.
135 On success the second field of the response line will have the value.
136 .TP
137 .B log
138 Send event log messages in a response body.
139 The command will never terminate.
140 Any further data sent to the server will be discarded (explicitly;
141 i.e. it will not accumulate in a buffer somewhere).
142 .IP
143 See \fBEVENT LOG\fR below for more details.
144 .TP
145 .B make\-cookie
146 Returns an opaque string that can be used by the \fBcookie\fR command to log
147 this user back in on another connection (until the cookie expires).
148 .TP
149 .B move \fITRACK\fR \fIDELTA\fR
150 Move a track in the queue.
151 The track may be identified by ID (preferred) or name (which might cause
152 confusion if it's there twice).
153 \fIDELTA\fR should be an negative or positive integer and indicates how
154 many steps towards the head of the queue the track should be moved.
155 .IP
156 Requires one of the \fBmove mine\fR, \fBmove random\fR or \fBmove any\fR rights
157 depending on how the track came to be added to the queue.
158 .TP
159 .B moveafter \fITARGET\fR \fIID\fR ...
160 Move all the tracks in the \fIID\fR list after ID \fITARGET\fR.
161 If \fITARGET\fR is the empty string then the listed tracks are put
162 at the head of the queue.
163 If \fITARGET\fR is listed in the ID list then the tracks are moved
164 to just after the first non-listed track before it, or to the head if there is
165 no such track.
166 .IP
167 Requires one of the \fBmove mine\fR, \fBmove random\fR or \fBmove any\fR rights
168 depending on how the tracks came to be added to the queue.
169 .TP
170 .B new \fR[\fIMAX\fR]
171 Send the most recently added \fIMAX\fR tracks in a response body.
172 If the argument is ommitted, the \fBnew_max\fR most recent tracks are
173 listed (see \fBdisorder_config\fR(5)).
174 .TP
175 .B nop
176 Do nothing.
177 Used by
178 .BR disobedience (1)
179 as a keepalive measure.
180 This command does not require authentication.
181 .TP
182 .B part \fITRACK\fR \fICONTEXT\fI \fIPART\fR
183 Get a track name part.
184 Returns an empty string if a name part cannot be constructed.
185 .IP
186 .I CONTEXT
187 is one of
188 .B sort
189 or
190 .B display
191 and
192 .I PART
193 is usually one of
194 .BR artist ,
195 .B album
196 or
197 .BR title .
198 .TP
199 .B pause
200 Pause the current track.
201 Requires the \fBpause\fR right.
202 .TP
203 .B play \fITRACK\fR
204 Add a track to the queue.
205 The response contains the queue ID of the track.
206 Requires the \fBplay\fR right.
207 .TP
208 .B playing
209 Report what track is playing.
210 .IP
211 If the response is \fB252\fR then the rest of the response line consists of
212 track information (see below).
213 .IP
214 If the response is \fB259\fR then nothing is playing.
215 .TP
216 .B playlist-delete \fIPLAYLIST\fR
217 Delete a playlist.
218 Requires permission to modify that playlist and the \fBplay\fR right.
219 .TP
220 .B playlist-get \fIPLAYLIST\fR
221 Get the contents of a playlist, in a response body.
222 Requires permission to read that playlist and the \fBread\fR right.
223 .TP
224 .B playlist-get-share \fIPLAYLIST\fR
225 Get the sharing status of a playlist.
226 The result will be \fBpublic\fR, \fBprivate\fR or \fBshared\fR.
227 Requires permission to read that playlist and the \fBread\fR right.
228 .TP
229 .B playlist-lock \fIPLAYLIST\fR
230 Lock a playlist.
231 Requires permission to modify that playlist and the \fBplay\fR right.
232 Only one playlist may be locked at a time on a given connection and the lock
233 automatically expires when the connection is closed.
234 .TP
235 .B playlist-set \fIPLAYLIST\fR
236 Set the contents of a playlist.
237 The new contents should be supplied in a command body.
238 Requires permission to modify that playlist and the \fBplay\fR right.
239 The playlist must be locked.
240 .TP
241 .B playlist-set-share \fIPLAYLIST\fR \fISHARE\fR
242 Set the sharing status of a playlist to
243 \fBpublic\fR, \fBprivate\fR or \fBshared\fR.
244 Requires permission to modify that playlist and the \fBplay\fR right.
245 .TP
246 .B playlist-unlock\fR
247 Unlock the locked playlist.
248 .TP
249 .B playlists
250 List all playlists that this connection has permission to read.
251 Requires the \fBread\fR right.
252 .TP
253 .B prefs \fBTRACK\fR
254 Send back the preferences for \fITRACK\fR in a response body.
255 Each line of the response has the usual line syntax, the first field being the
256 name of the pref and the second the value.
257 .TP
258 .B queue
259 Send back the current queue in a response body, one track to a line, the track
260 at the head of the queue (i.e. next to be be played) first.
261 See below for the track information syntax.
262 .TP
263 .B random\-disable
264 Disable random play (but don't stop the current track).
265 Requires the \fBglobal prefs\fR right.
266 .TP
267 .B random\-enable
268 Enable random play.
269 Requires the \fBglobal prefs\fR right.
270 .TP
271 .B random\-enabled
272 Report whether random play is enabled.
273 The second field of the response line will be \fByes\fR or \fBno\fR.
274 .TP
275 .B recent
276 Send back the current recently-played list in a response body, one track to a
277 line, the track most recently played last.
278 See below for the track information syntax.
279 .TP
280 .B reconfigure
281 Request that DisOrder reconfigure itself.
282 Requires the \fBadmin\fR right.
283 .TP
284 .B register \fIUSERNAME PASSWORD EMAIL
285 Register a new user.
286 Requires the \fBregister\fR right.
287 The result contains a confirmation string; the user will be be able
288 to log in until this has been presented back to the server via the
289 \fBconfirm\fR command.
290 .TP
291 .B reminder \fIUSERNAME\fR
292 Send a password reminder to user \fIUSERNAME\fR.
293 If the user has no valid email address, or no password, or a
294 reminder has been sent too recently, then no reminder will be sent.
295 .TP
296 .B remove \fIID\fR
297 Remove the track identified by \fIID\fR.
298 Requires one of the \fBremove mine\fR, \fBremove random\fR or
299 \fBremove any\fR rights depending on how the
300 track came to be added to the queue.
301 .TP
302 .B rescan \fR[\fBwait\fR] \fR[\fBfresh\fR]
303 Rescan all roots for new or obsolete tracks.
304 Requires the \fBrescan\fR right.
305 .IP
306 If the \fBwait\fR flag is present then the response is delayed until the rescan
307 completes.
308 Otherwise the response arrives immediately.
309 This is primarily intended for testing.
310 .IP
311 If the \fBfresh\fR flag is present a rescan is already underway then a second
312 rescan will be started when it completes.
313 The default behavior is to piggyback on the existing rescan.
314 .IP
315 NB that \fBfresh\fR is currently disabled in the server source, so using this
316 flag will just provoke an error.
317 .TP
318 .B resolve \fITRACK\fR
319 Resolve a track name, i.e. if this is an alias then return the real track name.
320 .TP
321 .B resume
322 Resume the current track after a \fBpause\fR command.
323 Requires the \fBpause\fR right.
324 .TP
325 .B revoke \fBcookie\fR
326 Revoke a cookie previously created with \fBmake\-cookie\fR.
327 It will not be possible to use this cookie in the future.
328 .TP
329 .B rtp\-address
330 Report the RTP broadcast (or multicast) address, in the form \fIADDRESS
331 PORT\fR.
332 This command does not require authentication.
333 .TP
334 .B scratch \fR[\fIID\fR]
335 Remove the track identified by \fIID\fR, or the currently playing track if no
336 \fIID\fR is specified.
337 Requires one of the \fBscratch mine\fR, \fBscratch random\fR or
338 \fBscratch any\fR rights depending on how the track came to be
339 added to the queue.
340 .TP
341 .B schedule-add \fIWHEN\fR \fIPRIORITY\fR \fIACTION\fR ...
342 Schedule an event for the future.
343 .IP
344 .I WHEN
345 is the time when it should happen, as \fBtime_t\fR value.
346 It must refer to a time in the future.
347 .IP
348 .I PRIORITY
349 is the event priority.
350 This can be \fBnormal\fR, in which case the event will be run at startup if its
351 time has past, or \fBjunk\fR in which case it will be discarded if it is found
352 to be in the past at startup.
353 The meaning of other values is not defined.
354 .IP
355 .I ACTION
356 is the action to perform.
357 The choice of action determines the meaning of the remaining arguments.
358 Possible actions are:
359 .RS
360 .TP
361 .B play
362 Play a track.
363 The next argument is the track name.
364 Requires the \fBplay\fR right.
365 .TP
366 .B set-global
367 Set a global preference.
368 The next argument is the preference name and the final argument is the value to
369 set it to (omit it to unset it).
370 Requires the \fBglobal prefs\fR right.
371 .RE
372 .IP
373 You need the right at the point you create the event.
374 It is not possible to create scheduled events in expectation of a future change
375 in rights.
376 .TP
377 .B schedule-del \fIEVENT\fR
378 Deletes a scheduled event.
379 Users can always delete their own scheduled events; with the \fBadmin\fR
380 right you can delete any event.
381 .TP
382 .B schedule-get \fIEVENT\fR
383 Sends the details of scheduled event \fIEVENT\fR in a response body.
384 Each line is a pair of strings quoted in the usual way, the first being the key
385 ane the second the value.
386 No particular order is used.
387 .IP
388 Scheduled events are considered public information.
389 Right \fBread\fR is sufficient to see details of all events.
390 .TP
391 .B schedule-list
392 Sends the event IDs of all scheduled events in a response body, in no
393 particular order.
394 Use \fBschedule-get\fR to get the details of each event.
395 .TP
396 .B search \fITERMS\fR
397 Search for tracks matching the search terms.
398 The results are put in a response body, one to a line.
399 .IP
400 The search string is split in the usual way, with quoting supported, into a
401 list of terms.
402 Only tracks matching all terms are included in the results.
403 .IP
404 Any terms of the form \fBtag:\fITAG\fR limits the search to tracks with that
405 tag.
406 .IP
407 All other terms are interpreted as individual words which must be present in
408 the track name.
409 .IP
410 Spaces in terms don't currently make sense, but may one day be interpreted to
411 allow searching for phrases.
412 .TP
413 .B \fBset\fR \fITRACK\fR \fIPREF\fR \fIVALUE\fR
414 Set a preference.
415 Requires the \fBprefs\fR right.
416 .TP
417 .B set\-global \fIKEY\fR \fIVALUE\fR
418 Set a global preference.
419 Requires the \fBglobal prefs\fR right.
420 .TP
421 .B stats
422 Send server statistics in plain text in a response body.
423 .TP
424 .B \fBtags\fR
425 Send the list of currently known tags in a response body.
426 .TP
427 .B \fBunset\fR \fITRACK\fR \fIPREF\fR
428 Unset a preference.
429 Requires the \fBprefs\fR right.
430 .TP
431 .B \fBunset\-global\fR \fIKEY\fR
432 Unset a global preference.
433 Requires the \fBglobal prefs\fR right.
434 .TP
435 .B user \fIUSERNAME\fR \fIRESPONSE\fR
436 Authenticate as user \fIUSERNAME\fR.
437 See
438 .B AUTHENTICATION
439 below.
440 .TP
441 .B userinfo \fIUSERNAME PROPERTY
442 Get a user property.
443 .TP
444 .B users
445 Send the list of currently known users in a response body.
446 .TP
447 .B version
448 Send back a response with the server version as the second field.
449 .TP
450 .B volume \fR[\fILEFT\fR [\fIRIGHT\fR]]
451 Get or set the volume.
452 .IP
453 With zero parameters just gets the volume and reports the left and right sides
454 as the 2nd and 3rd fields of the response.
455 .IP
456 With one parameter sets both sides to the same value.
457 With two parameters sets each side independently.
458 Setting the volume requires the \fBvolume\fR right.
459 .SH RESPONSES
460 Responses are three-digit codes.
461 The first digit distinguishes errors from succesful responses:
462 .TP
463 .B 2
464 Operation succeeded.
465 .TP
466 .B 5
467 Operation failed.
468 .PP
469 The second digit breaks down the origin of the response:
470 .TP
471 .B 0
472 Generic responses not specific to the handling of the command.
473 Mostly this is parse errors.
474 .TP
475 .B 1
476 51x errors indicate that the user had insufficient rights for the command.
477 .TP
478 .B 3
479 Authentication responses.
480 .TP
481 .B 5
482 Responses specific to the handling of the command.
483 .PP
484 The third digit provides extra information about the response:
485 .TP
486 .B 0
487 Text part is just commentary.
488 .TP
489 .B 1
490 Text part is a constant result e.g. \fBversion\fR.
491 .TP
492 .B 2
493 Text part is a potentially variable result.
494 .TP
495 .B 3
496 Text part is just commentary; a dot-stuffed body follows.
497 .TP
498 .B 4
499 Text part is just commentary; an indefinite dot-stuffed body follows.
500 (Used for \fBlog\fR.)
501 .TP
502 .B 5
503 Used with "normal" errors, for instance a preference not being found.
504 The text part is commentary.
505 .TP
506 .B 9
507 The text part is just commentary (but would normally be a response for this
508 command) e.g. \fBplaying\fR.
509 .PP
510 Result strings (not bodies) intended for machine parsing (i.e. xx1 and xx2
511 responses) are quoted.
512 .SH AUTHENTICATION
513 When a connection is made the server sends a \fB231\fR response before any
514 command is received.
515 This contains a protocol generation, an algorithm name and a
516 challenge encoded in hex, all separated by whitespace.
517 .PP
518 The current protocol generation is \fB2\fR.
519 .PP
520 The possible algorithms are (currently) \fBsha1\fR, \fBsha256\fR, \fBsha384\fR
521 and \fBsha512\fR.
522 \fBSHA1\fR etc work as synonyms.
523 .PP
524 The \fBuser\fR response consists of the selected hash of the user's password
525 concatenated with the challenge, encoded in hex.
526 .SH "TRACK INFORMATION"
527 Track information is encoded in a line (i.e. using the usual line syntax) as
528 pairs of fields.
529 The first is a name, the second a value.
530 The names have the following meanings:
531 .TP 12
532 .B expected
533 The time the track is expected to be played at.
534 .TP
535 .B id
536 A string uniquely identifying this queue entry.
537 .TP
538 .B played
539 The time the track was played at.
540 .TP
541 .B scratched
542 The user that scratched the track.
543 .TP
544 .B state
545 The current track state.
546 Valid states are:
547 .RS
548 .TP 12
549 .B failed
550 The player failed (exited with nonzero status but wasn't scratched).
551 .TP
552 .B isscratch
553 The track is actually a scratch.
554 .TP
555 .B no_player
556 No player could be found for the track.
557 .TP
558 .B ok
559 The track was played without any problems.
560 .TP
561 .B scratched
562 The track was scratched.
563 .TP
564 .B started
565 The track is currently playing.
566 .TP
567 .B unplayed
568 In the queue, hasn't been played yet.
569 .TP
570 .B quitting
571 The track was terminated because the server is shutting down.
572 .RE
573 .TP
574 .B submitter
575 The user that submitted the track.
576 .TP
577 .B track
578 The filename of the track.
579 .TP
580 .B when
581 The time the track was added to the queue.
582 .TP
583 .B wstat
584 The wait status of the player in decimal.
585 .SH NOTES
586 Times are decimal integers using the server's \fBtime_t\fR.
587 .PP
588 For file listings, the regexp applies to the basename of the returned file, not
589 the whole filename, and letter case is ignored.
590 \fBpcrepattern\fR(3) describes the regexp syntax.
591 .PP
592 Filenames are in UTF-8 even if the collection they come from uses some other
593 encoding - if you want to access the real file (in such cases as the filenames
594 actually correspond to a real file) you'll have to convert to whatever the
595 right encoding is.
596 .SH "EVENT LOG"
597 The event log consists of lines starting with a hexadecimal timestamp and a
598 keyword followed by (optionally) parameters.
599 The parameters are quoted in the usual DisOrder way.
600 Currently the following keywords are used:
601 .TP
602 .B completed \fITRACK\fR
603 Completed playing \fITRACK\fR
604 .TP
605 .B failed \fITRACK\fR \fIERROR\fR
606 Completed playing \fITRACK\fR with an error status
607 .TP
608 .B moved \fIUSERNAME\fR
609 User \fIUSERNAME\fR moved some track(s).
610 Further details aren't included any more.
611 .TP
612 .B playing \fITRACK\fR [\fIUSERNAME\fR]
613 Started playing \fITRACK\fR.
614 .TP
615 .B queue \fIQUEUE-ENTRY\fR...
616 Added \fITRACK\fR to the queue.
617 .TP
618 .B recent_added \fIQUEUE-ENTRY\fR...
619 Added \fIID\fR to the recently played list.
620 .TP
621 .B recent_removed \fIID\fR
622 Removed \fIID\fR from the recently played list.
623 .TP
624 .B removed \fIID\fR [\fIUSERNAME\fR]
625 Queue entry \fIID\fR was removed.
626 This is used both for explicit removal (when \fIUSERNAME\fR is present)
627 and when playing a track (when it is absent).
628 .TP
629 .B rescanned
630 A rescan completed.
631 .TP
632 .B scratched \fITRACK\fR \fIUSERNAME\fR
633 \fITRACK\fR was scratched by \fIUSERNAME\fR.
634 .TP
635 .B state \fIKEYWORD\fR
636 Some state change occurred.
637 The current set of keywords is:
638 .RS
639 .TP
640 .B completed
641 The current track completed successfully.
642 .TP
643 .B disable_play
644 Playing was disabled.
645 .TP
646 .B disable_random
647 Random play was disabled.
648 .TP
649 .B enable_play
650 Playing was enabled.
651 .TP
652 .B enable_random
653 Random play was enabled.
654 .TP
655 .B failed
656 The current track failed.
657 .TP
658 .B pause
659 The current track was paused.
660 .TP
661 .B playing
662 A track started playing.
663 .TP
664 .B resume
665 The current track was resumed.
666 .TP
667 .B rights_changed \fIRIGHTS\fR
668 User's rights were changed.
669 .TP
670 .B scratched
671 The current track was scratched.
672 .PP
673 To simplify client implementation, \fBstate\fR commands reflecting the current
674 state are sent at the start of the log.
675 .RE
676 .TB
677 .B user_add \fIUSERNAME\fR
678 A user was created.
679 .TP
680 .B user_delete \fIUSERNAME\fR
681 A user was deleted.
682 .TP
683 .B user_edit \fIUSERNAME\fR \fIPROPERTY\fR
684 Some property of a user was edited.
685 .TP
686 .B user_confirm \fIUSERNAME\fR
687 A user's login was confirmed (via the web interface).
688 .TP
689 .B volume \fILEFT\fR \fIRIGHT\fR
690 The volume changed.
691 .PP
692 .IR QUEUE-ENTRY ...
693 is as defined in
694 .B "TRACK INFORMATION"
695 above.
696 .PP
697 The \fBuser-*\fR messages are only sent to admin users, and are not sent over
698 non-local connections unless \fBremote_userman\fR is enabled.
699 .SH "CHARACTER ENCODING"
700 All data sent by both server and client is encoded using UTF-8.
701 Moreover it must be valid UTF-8, i.e. non-minimal sequences are not
702 permitted, nor are surrogates, nor are code points outside the
703 Unicode code space.
704 .PP
705 There are no particular normalization requirements on either side of the
706 protocol.
707 The server currently converts internally to NFC, the client must
708 normalize the responses returned if it needs some normalized form for further
709 processing.
710 .PP
711 The various characters which divide up lines may not be followed by combining
712 characters.
713 For instance all of the following are prohibited:
714 .TP
715 .B o
716 LINE FEED followed by a combining character.
717 For example the sequence LINE FEED, COMBINING GRAVE ACCENT is never permitted.
718 .TP
719 .B o
720 APOSTROPHE or QUOTATION MARK followed by a combining character when used to
721 delimit fields.
722 For instance a line starting APOSTROPHE, COMBINING CEDILLA is prohibited.
723 .IP
724 Note that such sequences are not prohibited when the quote character cannot be
725 interpreted as a field delimiter.
726 For instance APOSTROPHE, REVERSE SOLIDUS, APOSTROPHE, COMBINING CEDILLA,
727 APOSTROPHE would be permitted.
728 .TP
729 .B o
730 REVERSE SOLIDUS (BACKSLASH) followed by a combining character in a quoted
731 string when it is the first character of an escape sequence.
732 For instance a line starting APOSTROPHE, REVERSE SOLIDUS, COMBINING TILDE
733 is prohibited.
734 .IP
735 As above such sequences are not prohibited when the character is not being used
736 to start an escape sequence.
737 For instance APOSTROPHE, REVERSE SOLIDUS, REVERSE SOLIDS, COMBINING TILDE,
738 APOSTROPHE is permitted.
739 .TP
740 .B o
741 Any of the field-splitting whitespace characters followed by a combining
742 character when not part of a quoted field.
743 For instance a line starting COLON, SPACE, COMBINING CANDRABINDU is prohibited.
744 .IP
745 As above non-delimiter uses are fine.
746 .TP
747 .B o
748 The FULL STOP characters used to quote or delimit a body.
749 .PP
750 Furthermore none of these characters are permitted to appear in the context of
751 a canonical decomposition (i.e. they must still be present when converted to
752 NFC).
753 In practice however this is not an issue in Unicode 5.0.
754 .PP
755 These rules are consistent with the observation that the split() function is
756 essentially a naive ASCII parser.
757 The implication is not that these sequences never actually appear in
758 the protocol, merely that the server is not required to honor them in
759 any useful way nor be consistent between versions: in current
760 versions the result will be lines and fields that start with combining
761 characters and are not necessarily split where you expect, but future versions
762 may remove them, reject them or ignore some or all of the delimiters that have
763 following combining characters, and no notice will be given of any change.
764 .SH "SEE ALSO"
765 \fBdisorder\fR(1),
766 \fBtime\fR(2),
767 \fBdisorder\fR(3),
768 \fBpcrepattern\fR(3)
769 \fBdisorder_config\fR(5),
770 \fBdisorderd\fR(8),
771 \fButf8\fR(7)
772 .\" Local Variables:
773 .\" mode:nroff
774 .\" fill-column:79
775 .\" End: