Discussion:
[BitPim-devel] Non Unicode chars in SMS text
d***@netzero.com
2005-03-18 23:52:46 UTC
Permalink
Ran into this when I was testing the SMS code: some ISP insert cutesy non-unicode characters into their ads which are appended to outgoing mail messages, some of which are SMS messages. As a result, BitPim raised an exception while trying to save these messages. Any suggestions as how to handle this?

Thanks,

-Joe Pham



An unexpected exception has occurred.
Please see the help for details on what to do.

Traceback (most recent call last):
File "f:\My Documents\cell_apps\bitpim\gui.py", line 1256, in OnCallback
event()
File "f:\My Documents\cell_apps\bitpim\gui.py", line 122, in __call__
return apply(self.cb, self.args, self.kwargs)
File "f:\My Documents\cell_apps\bitpim\gui.py", line 79, in __call__
apply(self.method, self.args+args, d)
File "f:\My Documents\cell_apps\bitpim\gui.py", line 942, in OnDataGetPhoneResults
self.smswidget.populatefs(results)
File "f:\My Documents\cell_apps\bitpim\sms_tab.py", line 253, in populatefs
self.__save_to_db(dict.get(self.__data_key, {}))
File "f:\My Documents\cell_apps\bitpim\sms_tab.py", line 250, in __save_to_db
self.__main_window.database.savemajordict(self.__data_key, db_rr)
File "F:\My Documents\cell_apps\bitpim\database.py", line 263, in _transactionwrapper
return method(*args, **kwargs)
File "F:\My Documents\cell_apps\bitpim\database.py", line 507, in savemajordict
self.sql(" ".join(cmd), [timestamp]+[record[r] for r in rk])
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa1 in position 152: ordinal not in range(128)



______________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/month -visit http://www.netzero.com/surf to sign up today!
Yosef Meller
2005-03-19 10:59:47 UTC
Permalink
Post by d***@netzero.com
Ran into this when I was testing the SMS code: some ISP insert cutesy non-unicode characters into their ads which are appended to outgoing mail messages, some of which are SMS messages. As a result, BitPim raised an exception while trying to save these messages. Any suggestions as how to handle this?
Thanks,
-Joe Pham
I had a similar problem with reading phonebook entries in Hebrew. I
followed the discussion here and did the translation in the code that
reads the phonebook (under the assumption that a phone that uses
different encoding than what I hard-coded in would have a different module).

See com_sk6100.py for the code details.
Post by d***@netzero.com
An unexpected exception has occurred.
Please see the help for details on what to do.
File "f:\My Documents\cell_apps\bitpim\gui.py", line 1256, in OnCallback
event()
File "f:\My Documents\cell_apps\bitpim\gui.py", line 122, in __call__
return apply(self.cb, self.args, self.kwargs)
File "f:\My Documents\cell_apps\bitpim\gui.py", line 79, in __call__
apply(self.method, self.args+args, d)
File "f:\My Documents\cell_apps\bitpim\gui.py", line 942, in OnDataGetPhoneResults
self.smswidget.populatefs(results)
File "f:\My Documents\cell_apps\bitpim\sms_tab.py", line 253, in populatefs
self.__save_to_db(dict.get(self.__data_key, {}))
File "f:\My Documents\cell_apps\bitpim\sms_tab.py", line 250, in __save_to_db
self.__main_window.database.savemajordict(self.__data_key, db_rr)
File "F:\My Documents\cell_apps\bitpim\database.py", line 263, in _transactionwrapper
return method(*args, **kwargs)
File "F:\My Documents\cell_apps\bitpim\database.py", line 507, in savemajordict
self.sql(" ".join(cmd), [timestamp]+[record[r] for r in rk])
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa1 in position 152: ordinal not in range(128)
--
"No, I do not contain myself,"
were the final words from the set of self-excluding sets. :-)
Roger Binns
2005-03-19 18:40:10 UTC
Permalink
Post by d***@netzero.com
Ran into this when I was testing the SMS code: some ISP insert cutesy
non-unicode characters into their ads which are appended to outgoing
mail messages, some of which are SMS messages. As a result, BitPim
raised an exception while trying to save these messages. Any suggestions
as how to handle this?
The rule is very simple. All text must either be ASCII or Unicode.
If it isn't one of those then you need to convert it.

Roger
d***@netzero.com
2005-03-19 18:44:20 UTC
Permalink
I followed the discussion here and did the translation in the code
that reads the phonebook
I rember the thread now, thanks for the pointer.

The SMS support is now available in the Devel CVS for testing, viewing, or adding your phone support to it. Currently, only the Samsung SCH-A650/A670 phones have support for it.

-Joe Pham



______________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/month -visit http://www.netzero.com/surf to sign up today!
Roger Binns
2005-03-19 20:58:12 UTC
Permalink
Post by d***@netzero.com
Currently, only the Samsung SCH-A650/A670 phones have support for it.
Another challenge for you if you are interested. Can you see if you
can generate a help page that lists what features are supported by
the various phone models?

This will get you the list of models and what modules correspond to
them:

import guiwidgets
pm=guiwidgets.ConfigDialog.phonemodels
models=pm.keys()
models.sort()
for model in models:
module=__import__(pm[model])
... generate output based on inspecting module.Phone etc ...

Make the output look something like this as an HTML table.

Phonebook Calendar Filesystem SMS
R W R W R W R W

VX4400 Y Y Y Y Y
Sam650 Y Y Y Y Y Y

Generate the output as help/phonefeatures.htd

Roger
d***@netzero.com
2005-03-20 00:02:46 UTC
Permalink
Post by Roger Binns
generate a help page that lists what features are supported by
the various phone models?
Do you envision this being done at build time by running a standalone python app?

-Joe Pham



______________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/month -visit http://www.netzero.com/surf to sign up today!
Roger Binns
2005-03-20 07:19:54 UTC
Permalink
I've added the todo and sms help pages and ids.
Post by d***@netzero.com
Post by Roger Binns
generate a help page that lists what features are supported by
the various phone models?
Do you envision this being done at build time by running a standalone python app?
It will be done by a standalone script that will be invoked from
makehelp.sh

It should update the file help/phones-featuressupported.htd

Basically read the file in and change the lines between the relevant comments.
Remember to leave the comments in.

At some point we'll want to extend this so the individual per phone model
web pages can include a relevant portion of the table, as well as other
information such as wallpaper origins and sizes, limit of information
stored in the phonebook etc.

Roger
d***@netzero.com
2005-03-21 04:05:32 UTC
Permalink
Please review the attached phone feature list and report any inaccuracies.

Thanks,

-Joe Pham

phonebook ringtone memo sms
calendar wallpaper todo
r w r w r w r w r w r w r w
-------------------------------------------------------------------
AudiovCDM-8900 Y Y N N N N N N N N N N N N
LG-TM520 Y Y Y Y Y Y N N N N N N N N
LG-VX10 Y Y Y Y Y Y N N N N N N N N
LG-VX4400 Y Y Y Y Y Y Y Y N N N N N N
LG-VX4500 Y Y Y Y Y Y Y Y N N N N N N
LG-VX4600 Y Y Y Y Y Y Y Y N N N N N N
LG-VX6000 Y Y Y Y Y Y Y Y N N N N N N
LG-VX6100 Y Y Y Y Y Y Y Y N N N N N N
LG-VX7000 Y Y N N Y Y Y Y N N N N N N
LG-VX8000 Y Y N N Y Y Y Y N N N N N N
MM-7400 Y Y Y N Y Y Y Y N N N N N N
OtherCDMAhone N N N N N N N N N N N N N N
PM-8200 Y Y Y Y Y Y Y Y N N N N N N
RL-4920 Y Y Y Y Y Y Y Y N N N N N N
SCH-A310 Y Y Y Y N N N N N N N N N N
SCH-A650 Y Y Y Y Y Y Y Y Y Y Y Y Y N
SCH-A670 Y Y Y Y Y Y Y Y Y Y Y Y Y N
SCP-4900 Y Y Y Y N Y N Y N N N N N N
SCP-5300 Y Y Y Y N Y N Y N N N N N N
SCP-5400 Y Y Y Y Y Y Y Y N N N N N N
SCP-5500 Y Y Y Y Y Y Y Y N N N N N N
SCP-7200 Y Y Y Y N Y N Y N N N N N N
SCP-7300 Y Y Y Y Y Y Y Y N N N N N N
SCP-8100 Y Y Y Y Y Y Y Y N N N N N N
SCP-8100 Y Y Y Y Y N Y N N N N N N N
SK6100 Y N N N N N N N N N N N N N
SPH-A620 Y Y Y Y Y N Y N N N N N N N


______________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/month -visit http://www.netzero.com/surf to sign up today!
Yosef Meller
2005-03-21 05:28:54 UTC
Permalink
Post by d***@netzero.com
Please review the attached phone feature list and report any inaccuracies.
sk6100 is correct.
Post by d***@netzero.com
phonebook ringtone memo sms
calendar wallpaper todo
r w r w r w r w r w r w r w
-------------------------------------------------------------------
AudiovCDM-8900 Y Y N N N N N N N N N N N N
LG-TM520 Y Y Y Y Y Y N N N N N N N N
LG-VX10 Y Y Y Y Y Y N N N N N N N N
LG-VX4400 Y Y Y Y Y Y Y Y N N N N N N
LG-VX4500 Y Y Y Y Y Y Y Y N N N N N N
LG-VX4600 Y Y Y Y Y Y Y Y N N N N N N
LG-VX6000 Y Y Y Y Y Y Y Y N N N N N N
LG-VX6100 Y Y Y Y Y Y Y Y N N N N N N
LG-VX7000 Y Y N N Y Y Y Y N N N N N N
LG-VX8000 Y Y N N Y Y Y Y N N N N N N
MM-7400 Y Y Y N Y Y Y Y N N N N N N
OtherCDMAhone N N N N N N N N N N N N N N
PM-8200 Y Y Y Y Y Y Y Y N N N N N N
RL-4920 Y Y Y Y Y Y Y Y N N N N N N
SCH-A310 Y Y Y Y N N N N N N N N N N
SCH-A650 Y Y Y Y Y Y Y Y Y Y Y Y Y N
SCH-A670 Y Y Y Y Y Y Y Y Y Y Y Y Y N
SCP-4900 Y Y Y Y N Y N Y N N N N N N
SCP-5300 Y Y Y Y N Y N Y N N N N N N
SCP-5400 Y Y Y Y Y Y Y Y N N N N N N
SCP-5500 Y Y Y Y Y Y Y Y N N N N N N
SCP-7200 Y Y Y Y N Y N Y N N N N N N
SCP-7300 Y Y Y Y Y Y Y Y N N N N N N
SCP-8100 Y Y Y Y Y Y Y Y N N N N N N
SCP-8100 Y Y Y Y Y N Y N N N N N N N
SK6100 Y N N N N N N N N N N N N N
SPH-A620 Y Y Y Y Y N Y N N N N N N N
______________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/month -visit http://www.netzero.com/surf to sign up today!
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
--
"It doesn't just rock - it plays German Heavy Metal!"
- from some forum I can't remmember now (probably spreadfirefox.com)
Roger Binns
2005-03-21 06:07:02 UTC
Permalink
SCP-8100 Y Y Y Y Y Y Y Y N N N N N N
SCP-8100 Y Y Y Y Y N Y N N N N N N N
That phone is in twice.

Roger
John O'Shaughnessy
2005-03-21 05:08:15 UTC
Permalink
Post by d***@netzero.com
Please review the attached phone feature list and report any inaccuracies.
Thanks,
-Joe Pham
phonebook ringtone memo sms
calendar wallpaper todo
r w r w r w r w r w r w r w
-------------------------------------------------------------------
LG-VX6100 Y Y Y Y Y Y Y Y N N N N N N
LG-VX6100 YY YN YY YY ?? ?? ??

Calendar writing does not currently work.
I haven't had a chance to try Memo, Todo, or SMS yet.

John
d***@netzero.com
2005-03-21 05:26:18 UTC
Permalink
Yosef, thanks for your response.

-Joe Pham



______________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/month -visit http://www.netzero.com/surf to sign up today!
d***@netzero.com
2005-03-21 05:31:26 UTC
Permalink
John, thanks for your response. In this case, may I suggest a couple of things:

1. Copy _supportedsyncs from com_lgvx4400 and edit out the calendar item so that users won't be able attempt a calendar write (until it works correctly).
2. In your Phone class, set savecalendar=NotImplemented

Also, either one of those 2 changes would cause my script to work correctly.

-Joe Pham



______________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/month -visit http://www.netzero.com/surf to sign up today!
Roger Binns
2005-03-21 06:06:43 UTC
Permalink
Post by d***@netzero.com
John, thanks for your response. In this case, may I suggest a
Calendar support is pretty much broken for all LG phones as the
code suffered bitrot. I hope to get back to it in the near
future.

Just go ahead and generate the output against what the code
claims and I'll look into either fixing the LG code or
explicitly disabling it.

The web page should be identical to what happens if you use
the Get/Send menu.

Roger
d***@netzero.com
2005-03-21 06:16:19 UTC
Permalink
Post by Roger Binns
SCP-8100 Y Y Y Y Y Y Y Y N N N N N N
SCP-8100 Y Y Y Y Y N Y N N N N N N N
That phone is in twice.
My oversight. The 2nd one is actually 'SCP-8100 (Bell Mobility)', I did some manual editing to make it fit the screen.

-Joe Pham



______________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/month -visit http://www.netzero.com/surf to sign up today!
Roger Binns
2005-03-21 06:54:06 UTC
Permalink
Post by d***@netzero.com
My oversight. The 2nd one is actually 'SCP-8100 (Bell Mobility)',
I did some manual editing to make it fit the screen.
I suggest going ahead and regenerating the help file and then
posting it as an attachment.

Roger
d***@netzero.com
2005-03-21 16:31:01 UTC
Permalink
Post by Roger Binns
I suggest going ahead and regenerating the help file and then
posting it as an attachment.
Here it goes.

-Joe Pham
Roger Binns
2005-03-21 16:56:03 UTC
Permalink
Post by d***@netzero.com
Post by Roger Binns
I suggest going ahead and regenerating the help file and then
posting it as an attachment.
Here it goes.
Cool. When you run, invoke with python -O. (The Audiovox only shows
up when __debug__ is True). For blank cells, add   and the borders
will come out right.

Roger
d***@netzero.com
2005-03-21 17:39:24 UTC
Permalink
For blank cells, add   and the borders will come out right.
Got it. Do you want me to add a line to makehelp.sh while I'm at it?

-Joe Pham



______________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/month -visit http://www.netzero.com/surf to sign up today!
Loading...