RE: [bme-develop] Code imported into CVS
Status: Planning
Brought to you by:
sirmik
|
From: Sir M. <obe...@ho...> - 2004-03-27 15:34:13
|
Aloha Daniel,
>Hello. I found a few problem with some of the changes.
>The problem lays in that the MSN protocol uses the charset=UTF8 and so
>does BeOS for all the GUI text displaying classes. The problem is that
>BString cannot handle UTF8. So when you get the message body like this:
> BString im;
> message->FindString("body",&im);
>you get some problems for most of other non ascii characters, for
>example á,é,í,ó,ú, ñ (If you don't see this character change the
>encoding of the e-mail to Latin-1). I use these chars a lot since most
>of my conversations are in spanish. I think the best way to handle
>messages is to use char pointers instead of BStrings, to avoid any
>problems with character encodings.
Ohoh...didn't know that...the guys at BeShare said that the BStrings would
handle UTF8 well....so it does not...I never experienced those problems
because those characters aren't used much here...I changed it to BString
because the BString code is better organized, has more options and is a lot
easier than those c methods, which I find quite difficult to use....but if
it can't be done with BStrings then we have to use char* code...btw, what
about c++ strings? can they be used, they are object oriented to and have
most of the methods a BString has...or maybe implement our own version of a
BString using the c methods?
>
>On a separate note, some suggetions for changes
>
>Maybe move the "\r\n" replacing code to the MsnSBHandler to make the
>MsnChatter easier, clearer more straight forward, doing all the hard
>work in the Protocol classes.
>
Ah ok! it was more a quick fix for those problems, your suggestion is
better...btw, we have to try if we have to change the sending code to...so
we change the beOS \n to \r\n....so testing is needed where one person uses
MSN 6.0...
>into this:
> rgb_color rgb = rgb_color();
> msg.AddData("color",B_RGB_COLOR_TYPE,(const void*)&
>rgb,sizeof(rgb));
> ...
> const rgb_color *rgb; ssize_t sz_color;
> message->FindData("color",B_RGB_COLOR_TYPE,(const void**)&rgb,&
>sz_color);
>
I just copied your code...let's change it to this indeed...where is the
rgb_color code located btw? maybe I then can work on choosing a color ,font,
etc too...
>Create two methods in common.cpp
>char * getDateStr(char *str, const char *format, int size);
>char * getTimeStr(char *str, const char *format, int size);
>
>What do tou guys think?
>
Ok with me...btw another suggestion from me...I'm working on another beOS
project and I use constants in this way:
namespace Messages
{
const uint32 START_SIMULATION = 'STsi';
const uint32 STOP_SIMULATION = 'SPsi';
const uint32 SIMULATION_SETTINGS = 'SIse';
const uint32 SET_SIMULATION_SETTINGS = 'STss';
const uint32 NEW_CAMERA_DATA = 'NEcd';
const uint32 UPDATE_MSG = 'UPms';
const uint32 UPDATE_FAILURE = 'UPfa';
const uint32 NEW_COORDINATES = 'NEco';
}
other constants are in other namespace, I personally prefer this approach to
the c #define part because it's easier to understand...what do you think?
also I would prefer putting the methods in common.cpp in a namespace because
you can see that it's a method from common.cpp a lot easier:
old: thismethod();
new: Common::thismethod();
what do you think? I know it's quite a job to change all the #defines to
namespace...but I'm willing to change the code in that way...if you agree
with it....
regards,
Tim
_________________________________________________________________
Hotmail en Messenger on the move
http://www.msn.nl/communicatie/smsdiensten/hotmailsmsv2/
|