Re: Phone encoding error handling without rugs
"Simon C" <[email protected]>
| Newsgroups | gmane.comp.mobile.bitpim.devel |
|---|---|
| Message-ID | <[email protected]> |
> > I like a combination of this and your earlier plan. Make the STRING > class take an encoding parameter which defaults to ascii. Internally > it stores as UNICODE but reads and writes in the encoding. During testing I've found a problem with internal storage as unicode. Some packets contain "deleted" data, and the strings are garbage. Other parts of the code check the packet to determine it is garbage and the packet is never used, but if we convert to unicode on read it throws an exception on the garbage. I've changed the code to convert on "getvalue" instead, a just in time conversion. This will throw an exception if the conversion fails. If a packet is read from the phone and then written back without the value being gotten no conversion occurs and the same data as read is written back. Simon