Home > Archive > Programming with dBASE > October 2005 > read() and write()









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author read() and write()
eric wu

2005-10-27, 7:28 am

I have a problem on using sendmail.cc (from dUFLP) to attach PDF files due
to a non-English version windows .
I've found that because the .read( ) and .write() came out different result
,
I tried .read( 1 ) to read/write one by one , but it still doesn't
work.

it seems that when my Windows setup for double-byte characters

( Windows XP pro - Control panel - Regional Options - Language for
non-Unicode programs - Select a language to match the language version of
the non-Unicode program you want to use : Chinese )

the .read() converts the characters automatically to double-byte character
which cause the problem.
so my question is , how to tell the dBase to read/write characters without
convert ?
the other word, how to tell dBase to treat it as a single-byte under
double-byte windows environment ?



Ivar B. Jessen

2005-10-27, 7:28 am

On Tue, 25 Oct 2005 11:07:55 -0500, "eric wu" <ericwuu@hotmail.com> wrote:

>it seems that when my Windows setup for double-byte characters
>
>( Windows XP pro - Control panel - Regional Options - Language for
>non-Unicode programs - Select a language to match the language version of
>the non-Unicode program you want to use : Chinese )
>
>the .read() converts the characters automatically to double-byte character
>which cause the problem.
>so my question is , how to tell the dBase to read/write characters without
>convert ?
>the other word, how to tell dBase to treat it as a single-byte under
>double-byte windows environment ?


The OLH on 'file class' has this:

When reading or writing to a binary file, be sure to specify the "B" binary
access specifier. Without it, the file is treated as a text file; if the
current language driver is a multi-byte language, each character in the
file may be one or two bytes. Binary access ensures that each byte is read
and written without translation.


Ivar B. Jessen
eric wu

2005-10-27, 7:28 am

i tried both
f.open(FileName, "AB") or f.open(FileName, "A")

g.open( attactment1 , "RB") or g.open( attactment1 , "R")

non of them works.......

i was trying to get a PDF attached programmatically. the PDF file can not
be open ,it says it's damaged



"Ivar B. Jessen" <bergishagen@it.notthis.dk> wrote in message
news:glrsl1hcicdod07
531mgqq3rmh8hr1q116@
4ax.com...
> On Tue, 25 Oct 2005 11:07:55 -0500, "eric wu" <ericwuu@hotmail.com>
> wrote:
>
>
> The OLH on 'file class' has this:
>
> When reading or writing to a binary file, be sure to specify the "B"
> binary
> access specifier. Without it, the file is treated as a text file; if the
> current language driver is a multi-byte language, each character in the
> file may be one or two bytes. Binary access ensures that each byte is read
> and written without translation.
>
>
> Ivar B. Jessen



Ivar B. Jessen

2005-10-27, 7:28 am

On Wed, 26 Oct 2005 08:55:48 -0500, "eric wu" <ericwuu@hotmail.com> wrote:

>i tried both
> f.open(FileName, "AB") or f.open(FileName, "A")
>
> g.open( attactment1 , "RB") or g.open( attactment1 , "R")
>
>non of them works.......
>
>i was trying to get a PDF attached programmatically. the PDF file can not
>be open ,it says it's damaged


Sorry, I can't help you here. I have neither XP nor Chinese on my computer.
Maybe sombody else will step in.


Ivar B. Jessen
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com