* Functions to deal with character encodings and conversions
*/
-#include "imp.h"
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include "conn.h"
#include "log.h"
-#include "exp.h"
#include "conn-encoding.h"
#ifdef ICONV
char *Convert_Message PARAMS((iconv_t Handle, char *Message));
-
/**
* Set client character encoding on a connection.
*
out_left = sizeof(Encoding_Buffer) - 1;
if (iconv(Handle, &Message, &in_left, &out, &out_left) == (size_t)(-1)) {
- /* An error occured! */
+ /* An error occurred! */
LogDebug("Error converting message encoding!");
- strlcpy(Encoding_Buffer, Message, sizeof(Encoding_Buffer));
+ strlcpy(out, Message, sizeof(Encoding_Buffer));
iconv(Handle, NULL, NULL, NULL, NULL);
} else
*out = '\0';
return Encoding_Buffer;
}
-#endif
+#endif /* ICONV */
/**
* Convert encoding of a message received from a connection.