* [Bluez-devel] non-ASCII chars in device names
@ 2007-03-07 0:27 Bastien Nocera
2007-03-07 11:34 ` Marcel Holtmann
0 siblings, 1 reply; 4+ messages in thread
From: Bastien Nocera @ 2007-03-07 0:27 UTC (permalink / raw)
To: bluez-devel
Heya,
I got this report for gnome-bluetooth some time ago:
http://bugzilla.gnome.org/show_bug.cgi?id=380408
I fixed the problem altogether by replacing this code by D-Bus code
calling hcid. The problem is that the name of the device only shows up
the very first time the device is discovered, and it seems to me that
the cache is busted:
In hcid/storage.c:
for (i = 0; i < 248 && name[i]; i++)
if ((unsigned char) name[i] < 32 || name[i] == 127)
str[i] = '.';
else
str[i] = name[i];
Why? If the data is correct UTF-8, it could be saved as-is in the file,
minus any tabs, unbreakable spaces, or line feeds.
--
Bastien Nocera <hadess@hadess.net>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [Bluez-devel] non-ASCII chars in device names
2007-03-07 0:27 [Bluez-devel] non-ASCII chars in device names Bastien Nocera
@ 2007-03-07 11:34 ` Marcel Holtmann
2007-03-07 13:05 ` Bastien Nocera
0 siblings, 1 reply; 4+ messages in thread
From: Marcel Holtmann @ 2007-03-07 11:34 UTC (permalink / raw)
To: BlueZ development
Hi Bastien,
> I got this report for gnome-bluetooth some time ago:
> http://bugzilla.gnome.org/show_bug.cgi?id=380408
>
> I fixed the problem altogether by replacing this code by D-Bus code
> calling hcid. The problem is that the name of the device only shows up
> the very first time the device is discovered, and it seems to me that
> the cache is busted:
>
> In hcid/storage.c:
> for (i = 0; i < 248 && name[i]; i++)
> if ((unsigned char) name[i] < 32 || name[i] == 127)
> str[i] = '.';
> else
> str[i] = name[i];
>
> Why? If the data is correct UTF-8, it could be saved as-is in the file,
> minus any tabs, unbreakable spaces, or line feeds.
I don't see any problem with this code. It only replaces all ASCII
control characters (including delete). So this must be an issue with
still having the old name in the cache.
Regards
Marcel
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Bluez-devel] non-ASCII chars in device names
2007-03-07 11:34 ` Marcel Holtmann
@ 2007-03-07 13:05 ` Bastien Nocera
2007-03-07 3:31 ` Johan Hedberg
0 siblings, 1 reply; 4+ messages in thread
From: Bastien Nocera @ 2007-03-07 13:05 UTC (permalink / raw)
To: BlueZ development
On Wed, 2007-03-07 at 12:34 +0100, Marcel Holtmann wrote:
> Hi Bastien,
>
> > I got this report for gnome-bluetooth some time ago:
> > http://bugzilla.gnome.org/show_bug.cgi?id=380408
> >
> > I fixed the problem altogether by replacing this code by D-Bus code
> > calling hcid. The problem is that the name of the device only shows up
> > the very first time the device is discovered, and it seems to me that
> > the cache is busted:
> >
> > In hcid/storage.c:
> > for (i = 0; i < 248 && name[i]; i++)
> > if ((unsigned char) name[i] < 32 || name[i] == 127)
> > str[i] = '.';
> > else
> > str[i] = name[i];
> >
> > Why? If the data is correct UTF-8, it could be saved as-is in the file,
> > minus any tabs, unbreakable spaces, or line feeds.
>
> I don't see any problem with this code. It only replaces all ASCII
> control characters (including delete). So this must be an issue with
> still having the old name in the cache.
It wasn't the old cache (as I delete it, to be sure) but an old
bluez-utils (3.7) that had this problem. Works fine with 3.9.
Cheers
--
Bastien Nocera <hadess@hadess.net>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Bluez-devel] non-ASCII chars in device names
2007-03-07 13:05 ` Bastien Nocera
@ 2007-03-07 3:31 ` Johan Hedberg
0 siblings, 0 replies; 4+ messages in thread
From: Johan Hedberg @ 2007-03-07 3:31 UTC (permalink / raw)
To: bluez-devel
Hi Bastien,
On Wed, Mar 07, 2007, Bastien Nocera wrote:
> > > In hcid/storage.c:
> > > for (i = 0; i < 248 && name[i]; i++)
> > > if ((unsigned char) name[i] < 32 || name[i] == 127)
> > > str[i] = '.';
> > > else
> > > str[i] = name[i];
> > >
> > > Why? If the data is correct UTF-8, it could be saved as-is in the file,
> > > minus any tabs, unbreakable spaces, or line feeds.
> >
> > I don't see any problem with this code. It only replaces all ASCII
> > control characters (including delete). So this must be an issue with
> > still having the old name in the cache.
>
> It wasn't the old cache (as I delete it, to be sure) but an old
> bluez-utils (3.7) that had this problem. Works fine with 3.9.
Yep, in 3.7 the unsigned char typecast was missing which caused all
greater than 7 bit characters to be replaced by '.'
Johan
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-03-07 13:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-07 0:27 [Bluez-devel] non-ASCII chars in device names Bastien Nocera
2007-03-07 11:34 ` Marcel Holtmann
2007-03-07 13:05 ` Bastien Nocera
2007-03-07 3:31 ` Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox