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

(-)linux-2.6.13-rc6-git7-3.orig/drivers/char/consolemap.c (-6 / +21 lines)
Lines 221-236 Link Here
221
 *    was active, or using Unicode.
221
 *    was active, or using Unicode.
222
 * Still, it is now possible to a certain extent to cut and paste non-ASCII.
222
 * Still, it is now possible to a certain extent to cut and paste non-ASCII.
223
 */
223
 */
224
unsigned char inverse_translate(struct vc_data *conp, int glyph)
224
u16 inverse_translate(struct vc_data *conp, int glyph)
225
{
225
{
226
	struct uni_pagedir *p;
226
	struct uni_pagedir *p;
227
	if (glyph < 0 || glyph >= MAX_GLYPH)
227
	if (glyph < 0 || glyph >= MAX_GLYPH)
228
		return 0;
228
		return 0;
229
	else if (!(p = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc) ||
229
	if (conp->vc_utf) {
230
		 !p->inverse_translations[inv_translate[conp->vc_num]])
230
		/* hack: works probably only w/ latin1 */
231
		return glyph;
231
		if (glyph < 0x80) {
232
	else
232
			return glyph;
233
		return p->inverse_translations[inv_translate[conp->vc_num]][glyph];
233
		} else if (glyph < 0x0100) {
234
			unsigned char hi, lo;
235
			hi = (glyph >> 6) | 0xc0;
236
			lo = (glyph & 0x3f) | 0x80;
237
			return hi << 8 | lo;
238
		} else {
239
			printk(KERN_DEBUG "inverse_translate: unknown glyph %04X\n", glyph);
240
			return '?';
241
		}
242
	} else {
243
		if (!(p = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc) ||
244
			 !p->inverse_translations[inv_translate[conp->vc_num]])
245
			return glyph;
246
		else
247
			return p->inverse_translations[inv_translate[conp->vc_num]][glyph];
248
	}
234
}
249
}
235
250
236
static void update_user_maps(void)
251
static void update_user_maps(void)
(-)linux-2.6.13-rc6-git7-3.orig/drivers/char/selection.c (-3 / +9 lines)
Lines 54-60 Link Here
54
	complement_pos(sel_cons, where);
54
	complement_pos(sel_cons, where);
55
}
55
}
56
56
57
static unsigned char
57
static u16
58
sel_pos(int n)
58
sel_pos(int n)
59
{
59
{
60
	return inverse_translate(sel_cons, screen_glyph(sel_cons, n));
60
	return inverse_translate(sel_cons, screen_glyph(sel_cons, n));
Lines 240-246 Link Here
240
	sel_end = new_sel_end;
240
	sel_end = new_sel_end;
241
241
242
	/* Allocate a new buffer before freeing the old one ... */
242
	/* Allocate a new buffer before freeing the old one ... */
243
	bp = kmalloc((sel_end-sel_start)/2+1, GFP_KERNEL);
243
	bp = kmalloc((sel_end-sel_start)+1, GFP_KERNEL);
244
	if (!bp) {
244
	if (!bp) {
245
		printk(KERN_WARNING "selection: kmalloc() failed\n");
245
		printk(KERN_WARNING "selection: kmalloc() failed\n");
246
		clear_selection();
246
		clear_selection();
Lines 252-258 Link Here
252
252
253
	obp = bp;
253
	obp = bp;
254
	for (i = sel_start; i <= sel_end; i += 2) {
254
	for (i = sel_start; i <= sel_end; i += 2) {
255
		*bp = sel_pos(i);
255
		u16 utf = sel_pos(i);
256
		if (!(utf & 0xff00)) {
257
			*bp = utf & 0x00ff;
258
		} else {
259
			*bp++ = utf >> 8;
260
			*bp = utf & 0x00ff;
261
		}
256
		if (!isspace(*bp++))
262
		if (!isspace(*bp++))
257
			obp = bp;
263
			obp = bp;
258
		if (! ((i + 2) % vc->vc_size_row)) {
264
		if (! ((i + 2) % vc->vc_size_row)) {
(-)linux-2.6.13-rc6-git7-3.orig/include/linux/consolemap.h (-1 / +1 lines)
Lines 10-15 Link Here
10
10
11
struct vc_data;
11
struct vc_data;
12
12
13
extern unsigned char inverse_translate(struct vc_data *conp, int glyph);
13
extern u16 inverse_translate(struct vc_data *conp, int glyph);
14
extern unsigned short *set_translate(int m, struct vc_data *vc);
14
extern unsigned short *set_translate(int m, struct vc_data *vc);
15
extern int conv_uni_to_pc(struct vc_data *conp, long ucs);
15
extern int conv_uni_to_pc(struct vc_data *conp, long ucs);

Return to bug 104867