Package: brltty-udeb
Version: 3.9-5
Severity: normal
Tags: patch
Hello,
The debian installer has very small support for iconv: it mostly has
only UTF-8 and WCHAR_T, which is not enough for brltty 3.9. The
attached patch fixes that by backporting the use of wchar_t, and by
setting the default charset to UTF-8.
Samuel
-- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1,
'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.24.1
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/bash
--
Samuel
SL> Au fait elle est mieux ma signature maintenant ?
Oui. T'enlève encore les conneries que t'as écrit dedans et c'est bon.
-+- JB in <http://neuneu.mine.nu> : Le neueuttoyage par le vide -+-
--- BrailleDrivers/TTY/braille.c-orig 2008-02-23 16:42:05.000000000 +0100
+++ BrailleDrivers/TTY/braille.c 2008-02-23 17:37:12.000000000 +0100
@@ -21,6 +21,7 @@
#include <string.h>
#include <errno.h>
#include <locale.h>
+#include <wchar.h>
#include <limits.h>
#ifndef MB_MAX_LEN
@@ -114,7 +115,7 @@ brl_construct (BrailleDisplay *brl, char
int windowColumns = 40;
#ifdef HAVE_ICONV_H
- char *characterSet = "ISO8859-1";
+ char *characterSet = "UTF-8";
#endif /* HAVE_ICONV_H */
if (!isSerialDevice(&device)) {
@@ -164,7 +165,7 @@ brl_construct (BrailleDisplay *brl, char
classificationLocale = parameters[PARM_LOCALE];
#ifdef HAVE_ICONV_H
- if ((conversionDescriptor = iconv_open(characterSet, "ISO8859-1")) !=
(iconv_t)-1) {
+ if ((conversionDescriptor = iconv_open(characterSet, "WCHAR_T")) !=
(iconv_t)-1) {
#endif /* HAVE_ICONV_H */
if ((ttyDevice = serialOpenDevice(device))) {
if (serialRestartDevice(ttyDevice, ttyBaud)) {
@@ -246,10 +247,10 @@ static void
writeText (const unsigned char *buffer, int columns) {
int column;
for (column=0; column<columns; column++) {
- char c = buffer[column];
+ wchar_t c = buffer[column];
#ifdef HAVE_ICONV_H
- char *pc = &c;
- size_t sc = 1;
+ char *pc = (char*) &c;
+ size_t sc = sizeof(wchar_t);
char d[MB_MAX_LEN+1];
char *pd = d;
size_t sd = MB_MAX_LEN;