2 * ngIRCd -- The Next Generation IRC Daemon
3 * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 * Please read the file COPYING, README and AUTHORS for more information.
16 * IRC encoding commands
24 #include "conn-func.h"
26 #include "conn-encoding.h"
27 #include "irc-write.h"
33 * Handler for the IRC+ "CHARCONV" command.
35 * @param Client The client from which this command has been received.
36 * @param Req Request structure with prefix and all parameters.
37 * @returns CONNECTED or DISCONNECTED.
40 IRC_CHARCONV(CLIENT *Client, REQUEST *Req)
44 assert (Client != NULL);
47 strlcpy(encoding, Req->argv[0], sizeof(encoding));
48 ngt_UpperStr(encoding);
50 if (!Conn_SetEncoding(Client_Conn(Client), encoding))
51 return IRC_WriteErrClient(Client, ERR_IP_CHARCONV_MSG,
52 Client_ID(Client), encoding);
54 return IRC_WriteStrClient(Client, RPL_IP_CHARCONV_MSG,
55 Client_ID(Client), encoding);