× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Interesting:

"The write() will attempt to convert all of the data in the
user's buffer. Successfully converted data will be written.
Unconverted data is usually assumed to be a partial
character. Partial characters will be buffered internally
and data from the next consecutive write will be appended
to the buffered data. If incorrect data is provided on a
consecutive write, the write may fail with the [ECONVERT]
error. "

I don't get this when writing the text as is, but when I
enclose it in parens and a single quote at the end, it
errors out.

Could I be figuring the length of the data wrong?  I
wouldn't think that would be the case....  I'm using CHECKR
for a blank to get the length (long story why I'm not using
%len).


Brad

On Wed, 01 Nov 2006 21:43:30 -0500
 "Brad Stone" <brad@xxxxxxxxxxxx> wrote:

I found more information on this doing a debug.  It may
or
may not relate to my socket CCSID issue I am having.

On the call to the write() API, I'm writing out 128
bytes.
 The return code after the call is saying it wrote 3490
bytes.  There are probably 10 DBCS character in this
data..
the rest is SBCS.  But every write after this, even
containing SBCS is corrupted.  And the RC for SBCS data
write() calls shows the same amount of bytes written as I
told it to write.

It's almost like it's totally messing up my pointer
position as I am using %addr() for the data parm on the
write() API.

Any ideas, I'm open ... off to scour the docs now.. 

Brad

On Tue, 31 Oct 2006 22:32:16 -0500
 "Brad Stone" <brad@xxxxxxxxxxxx> wrote:
Ok, this one really is weird.

I am converting files to different formats.  The data
contains DBCS data and SBCS data.

We got past the point of making a plain text or .doc
file
working (.doc being basically a plain text with CRLF
for
the lines).

Now we're doing PDF.  Which technically should make
zero
difference.

We read the data in (a line of text), then write it out
to
a stream file using the write() API.

When it hits the line with the DBCS data in it, it just
freaks out and starts writing garbage to the file.

The ONLY difference in the text we're writing out is it
is
enclosed in ( and ) ends with a single quote.

I checked the data right before the Write(), checked
the
length it was passing in, and everything is fine!  It
writes 12 lines before this one just fine, but once it
hits
the DBCS data, boom.

Makes no sense to me.  It is PDF data, but it's really
"just plain text".  And all data after it, even straigh
SBCS data is also garbage.

The only thing I could find was the hex value for the
line
that it starting bombing out on, instead of writing the
real data, it was x'FEFE'

The only thing I can think of here is a bug in the OS
with
the write() API.

Anyone else seen anything like this, or have any ideas?

So:

eval Data = 'This is DBCS Data'

if I write just Data, it is fine, even the DBCS data.

If I do:

eval Data = '(' + %trimr(Data) + ') '''

It starts writing just garbage.. and not even the same
length of string garbage.  :)

Argh  [pulling hair out]

Thanks in advance!
-- 
This is the RPG programming on the AS400 / iSeries
(RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the
archives
at http://archive.midrange.com/rpg400-l.


Bradley V. Stone
BVS.Tools
www.bvstools.com
-- 
This is the RPG programming on the AS400 / iSeries
(RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the
archives
at http://archive.midrange.com/rpg400-l.


Bradley V. Stone
BVS.Tools
www.bvstools.com

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.