2 * ngIRCd -- The Next Generation IRC Daemon
3 * Copyright (c)2001-2013 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
22 #include "conn-func.h"
24 #include "conn-encoding.h"
25 #include "irc-write.h"
30 #include "irc-encoding.h"
35 * Handler for the IRC+ "CHARCONV" command.
37 * @param Client The client from which this command has been received.
38 * @param Req Request structure with prefix and all parameters.
39 * @returns CONNECTED or DISCONNECTED.
42 IRC_CHARCONV(CLIENT *Client, REQUEST *Req)
46 assert (Client != NULL);
49 strlcpy(encoding, Req->argv[0], sizeof(encoding));
50 ngt_UpperStr(encoding);
52 if (!Conn_SetEncoding(Client_Conn(Client), encoding))
53 return IRC_WriteErrClient(Client, ERR_IP_CHARCONV_MSG,
54 Client_ID(Client), encoding);
56 return IRC_WriteStrClient(Client, RPL_IP_CHARCONV_MSG,
57 Client_ID(Client), encoding);