View | Details | Raw Unified | Return to bug 5054
Collapse All | Expand All

(-)rdesktop-1.3.1.orig/rdesktop.c (+5 lines)
Lines 27-32 Link Here
27
#include <sys/time.h>		/* gettimeofday */
27
#include <sys/time.h>		/* gettimeofday */
28
#include <sys/times.h>		/* times */
28
#include <sys/times.h>		/* times */
29
#include <errno.h>
29
#include <errno.h>
30
#include <locale.h>
30
#include "rdesktop.h"
31
#include "rdesktop.h"
31
32
32
#ifdef EGD_SOCKET
33
#ifdef EGD_SOCKET
Lines 223-228 Link Here
223
	flags = RDP_LOGON_NORMAL;
224
	flags = RDP_LOGON_NORMAL;
224
	prompt_password = False;
225
	prompt_password = False;
225
	domain[0] = password[0] = shell[0] = directory[0] = 0;
226
	domain[0] = password[0] = shell[0] = directory[0] = 0;
227
228
	/* Initalize locale support */
229
	setlocale(LC_ALL, "");
230
226
	strcpy(keymapname, "en-us");
231
	strcpy(keymapname, "en-us");
227
232
228
#ifdef RDP2VNC
233
#ifdef RDP2VNC
(-)rdesktop-1.3.1.orig/rdp.c (-9 / +32 lines)
Lines 19-24 Link Here
19
*/
19
*/
20
20
21
#include <time.h>
21
#include <time.h>
22
#include <errno.h>
23
#include <iconv.h>
24
#include <langinfo.h>
22
#include "rdesktop.h"
25
#include "rdesktop.h"
23
26
24
extern uint16 g_mcs_userid;
27
extern uint16 g_mcs_userid;
Lines 119-135 Link Here
119
void
122
void
120
rdp_out_unistr(STREAM s, char *string, int len)
123
rdp_out_unistr(STREAM s, char *string, int len)
121
{
124
{
122
	int i = 0, j = 0;
125
	int i = 0, j = 0, initlen, avail;
123
126
	char *incharset, *wptr, *outstr;
124
	len += 2;
127
	iconv_t cd;
125
128
126
	while (i < len)
129
	incharset = nl_langinfo(CODESET);
127
	{
130
	cd = iconv_open("UTF16LE", incharset);
131
	if(cd == (iconv_t)-1)
132
	{
133
	    if (errno == EINVAL)
134
		error (0, 0, "conversion from '%s' to 'UTF16LE' not available", incharset);
135
	    else
136
		perror ("iconv_open");
137
	    error(0, 0, "Iconv conversion failed. Using build-in conversion to Latin1");
138
	    len += 2;
139
	    while (i < len)
140
	    {
128
		s->p[i++] = string[j++];
141
		s->p[i++] = string[j++];
129
		s->p[i++] = 0;
142
		s->p[i++] = 0;
130
	}
143
	    }
131
144
	    s->p += len;
132
	s->p += len;
145
	    return;
146
	}
147
	initlen = avail = len + 2;
148
	len = strlen(string);
149
	wptr = outstr = malloc(initlen);
150
	iconv(cd, &string, &len, &wptr, &avail);
151
	iconv_close(cd);
152
	memset(s->p, '\0', initlen - avail + 2);
153
	memcpy(s->p, outstr, initlen - avail);
154
	s->p += initlen - avail + 2;
155
	free(outstr);
133
}
156
}
134
157
135
/* Parse a logon info packet */
158
/* Parse a logon info packet */

Return to bug 5054