|
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) |