DBField>>asString index out of range

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

DBField>>asString index out of range

Howard Oh
when i try to access a string field from DB, i get error below.


DBField>>asString
        "Private - Answer the receiver's buffer as a <String>."

        ^buffer copyStringFrom: 1 to: self length


It fails because  " self length > buffer size ".
" self length = buffer size " is kept while the content of the field is
english.
the problem occurrs when the field content is my native language( Two
byte long characters ).

by defining table by the field type text, utext, uchar, varchar,
uvarchar gives the same error.






If the method is fixed as below, the error never occurs.


DBField>>asString
        "Private - Answer the receiver's buffer as a <String>."

        ^buffer copyStringFrom: 1 to: buffer size-1