Problem Writing UniCode Data to File
| Thu, 2006-04-27 19:02 | |
|
|
Hi all, I'm collecting Network parameters in my app using the MobInfo Library. When i write them to file, I'm having boxes and "/" written in the place of actual data... I think that the error is due to the Unicode convertion... For example, the CellID value is a TUInt which displays correctly on the screen, but in the file, i get the data as [. Signal Strength is TInt but the value i get is Do enlighten me on this!!!! The Cruise is on... |






Maybe the contents are actually correct unicode but you are viewing the file using notepad or similar.
Forum posts: 37
On the PC, i'm using TextPad...
The Cruise is on...
Forum posts: 37
The \ for Cell ID and the for Signal Strength...
The Cruise is on...
Forum posts: 1232
To me it looks a bit like you have written the value directly to file without converting it to a string first.
Forum posts: 37
I'm collecting the CellId and SignalStrength values into two variables cellid and SignalStrength... and i'm adding them to a buffer...
//other code
fileWriteBuf.Append(cellid().iCellId);
//other code
fileWriteBuf.Append(SignalStrength);
//some more other code...
iFile.Write(fileWriteBuf, iStatus);
iFile.Flush();
Is this wrong???
The Cruise is on...
Its as alh says, you are writing binary data but viewing it with applications expecting text. If you want to be able to read the contents in a way that is intelligible to a human you have to convert it.
If you are just checking the contents of the file to see if they are correct you need a viewer which isn't expecting text date.
Forum posts: 37
The problem is i'm having the other values like IMEI, IMSI, MCC written whereas i'm having these two values not being written...
The Cruise is on...
>>Signal Strength is TInt
and imei is declared as a TInt or TUint also?