/*
 * The RISC OS Latin-1 alphabet against Unicode, both ways.
 *   Copyright RISC OS Developments 2019+, credited to the RISC OS One Project.
 *
 * SMB1 carried names as bytes and a RISC OS machine could put its own
 * bytes on the wire unaltered.  SMB2 carries them as UTF-16, so every
 * name has to be converted, and the conversion is not the identity: the
 * range &80-&9F, which in Latin-1 proper is a block of control codes, is
 * where RISC OS keeps the Euro sign, the W and Y circumflexes, the
 * quotation marks, the dashes and the ligatures.  Treating a name as
 * Latin-1 leaves all thirty-two of those wrong in both directions.
 */

#ifndef _ALPHABET_
#define _ALPHABET_

/*
    A RISC OS character as its Unicode code point.  Every character in the
    alphabet has one; the six positions RISC OS leaves undefined give
    U+FFFD, which is what a server will show for them.
*/
unsigned int AlphabetToUnicode(unsigned int ch);

/*
    A Unicode code point as a RISC OS character, or 0 where the alphabet
    has no such character - which includes every code point above U+00FF
    that is not one of the thirty-two, and the C1 controls U+0080-U+009F,
    whose byte values RISC OS uses for something else entirely.
*/
unsigned int AlphabetFromUnicode(unsigned int u);

#endif
