What encoding do strings in IOBluetoothSDPDataElement structures use?
What encoding do strings in IOBluetoothSDPDataElement structures use?
- Subject: What encoding do strings in IOBluetoothSDPDataElement structures use?
- From: Thomas Tempelmann <email@hidden>
- Date: Tue, 27 Mar 2007 00:35:39 +0200
- Thread-topic: What encoding do strings in IOBluetoothSDPDataElement structures use?
I wonder if it was smart to store byte sequences of SDP records as NSStrings
only because the SDP specification calls them "strings".
The problem at hand is that I need to store non-textual strings in the SDP
records but apparently can't: Apple's Bluetooth libs require me to pass the
data in NSString containers, but those are for text, and need a encoding,
which is basically nonsense, it appears to me.
I am trying to store a sequence of bytes into an NSString, but when I try to
store it as a UTF8 string, the [NSString initFromData] call does come back
with nil - apparently it does not like the data I passed as it's not valid
UTF8. So what can I do? I cannot find a "binary data" encoding. And when I
use some other encoding, then I might have to risk that when generating the
actual SDP data that gets passed to other devices, it gets converted into a
different encoding, altering my original data.
How can this be solved?
Thomas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden