Re: [sqlite] Double Spaced Blob Text

2011-09-07 Thread Filip Navara
I guess the database is encoded in UTF-16 and you are reading the text
using sqlite3_column_blob instead of sqlite3_column_text.

F.

On Wed, Sep 7, 2011 at 5:15 PM, Daniel Spain  wrote:
>
>
>
>
> hello all i am creating a text mud gamibng engine and has been going great up 
> until recently.when a user is examining their current room all the text is 
> double spaced.i have tried this as both a blob and text field with a max 
> length of 4096. here is my funtion to display long room descriptions: GBOOL 
> EXPORTlook(VOID)/* examine current room */{       if(islit(chrptr->loc))      
>   {            prfmlt(LOKOTH,chrptr->name);             
> outloc(getloc(usrnum),usrnum,-1);            
> prfmlt(LOOKING,database_blob("Rooms",chrptr->loc,ROOMKEY_LONGDESC));          
>   outmlt(usrnum);       }       else       {           prfmlt(TOODRK);        
>    outmlt(usrnum);       }       return(TRUE);} here is the database_blob 
> function: CHAR * EXPORTdatabase_blob(const CHAR *table,const LONG 
> record,const LONG field)/* return blob field value from a table */{     const 
> CHAR *tail;     static CHAR ret[4096];      strcpy(ret,"NULL");      
> sprintf(vdatmp,"SELECT * FROM %s WHERE Record = %ld",table,record)
>  ;     
> if(sqlite3_prepare_v2(database,vdatmp,strlen(vdatmp),&statement,&tail)==SQLITE_OK)
>      {         while(sqlite3_step(statement) == SQLITE_ROW)         {         
>       strncpy(ret,sqlite3_column_blob(statement,field),4096);         }     } 
>      return(ret);}  it all works fine it just double spaces the returned 
> text.some of my beta testers stripped all the periods from the text and 
> saidit worked fine so i don't know if the periods are somehow sayingmove to 
> the next line or what. thanks.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Double Spaced Blob Text

2011-09-07 Thread Black, Michael (IS)
I sincerely doubt that sqlite is your problem as everybody else would be seeing 
the same problem.



What is the prfmlt() function?  I would suspect whatever is interpreting your 
output stream is the culprit.



I've seen historically where a period can mean end-of-line.





Michael D. Black

Senior Scientist

NG Information Systems

Advanced Analytics Directorate




From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Daniel Spain [dspai...@msn.com]
Sent: Wednesday, September 07, 2011 10:15 AM
To: sqlite-users@sqlite.org
Subject: EXT :[sqlite] Double Spaced Blob Text





hello all i am creating a text mud gamibng engine and has been going great up 
until recently.when a user is examining their current room all the text is 
double spaced.i have tried this as both a blob and text field with a max length 
of 4096. here is my funtion to display long room descriptions: GBOOL 
EXPORTlook(VOID)/* examine current room */{   if(islit(chrptr->loc))
{prfmlt(LOKOTH,chrptr->name); 
outloc(getloc(usrnum),usrnum,-1);
prfmlt(LOOKING,database_blob("Rooms",chrptr->loc,ROOMKEY_LONGDESC));
outmlt(usrnum);   }   else   {   prfmlt(TOODRK);   
outmlt(usrnum);   }   return(TRUE);} here is the database_blob 
function: CHAR * EXPORTdatabase_blob(const CHAR *table,const LONG record,const 
LONG field)/* return blob field value from a table */{ const CHAR *tail;
 static CHAR ret[4096];  strcpy(ret,"NULL");  sprintf(vdatmp,"SELECT * 
FROM %s WHERE Record = %ld",table,record)
 ; 
if(sqlite3_prepare_v2(database,vdatmp,strlen(vdatmp),&statement,&tail)==SQLITE_OK)
 { while(sqlite3_step(statement) == SQLITE_ROW) {   
strncpy(ret,sqlite3_column_blob(statement,field),4096); } } 
 return(ret);}  it all works fine it just double spaces the returned text.some 
of my beta testers stripped all the periods from the text and saidit worked 
fine so i don't know if the periods are somehow sayingmove to the next line or 
what. thanks.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Double Spaced Blob Text

2011-09-07 Thread Daniel Spain




hello all i am creating a text mud gamibng engine and has been going great up 
until recently.when a user is examining their current room all the text is 
double spaced.i have tried this as both a blob and text field with a max length 
of 4096. here is my funtion to display long room descriptions: GBOOL 
EXPORTlook(VOID)/* examine current room */{   if(islit(chrptr->loc))
{prfmlt(LOKOTH,chrptr->name); 
outloc(getloc(usrnum),usrnum,-1);
prfmlt(LOOKING,database_blob("Rooms",chrptr->loc,ROOMKEY_LONGDESC));
outmlt(usrnum);   }   else   {   prfmlt(TOODRK);   
outmlt(usrnum);   }   return(TRUE);} here is the database_blob 
function: CHAR * EXPORTdatabase_blob(const CHAR *table,const LONG record,const 
LONG field)/* return blob field value from a table */{ const CHAR *tail;
 static CHAR ret[4096];  strcpy(ret,"NULL");  sprintf(vdatmp,"SELECT * 
FROM %s WHERE Record = %ld",table,record)
 ; 
if(sqlite3_prepare_v2(database,vdatmp,strlen(vdatmp),&statement,&tail)==SQLITE_OK)
 { while(sqlite3_step(statement) == SQLITE_ROW) {   
strncpy(ret,sqlite3_column_blob(statement,field),4096); } } 
 return(ret);}  it all works fine it just double spaces the returned text.some 
of my beta testers stripped all the periods from the text and saidit worked 
fine so i don't know if the periods are somehow sayingmove to the next line or 
what. thanks.  
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users