On 18.08.2022 12:24, Rick McGuire wrote:
The data written is split at linend boundaries.

Thank you for the clarification!

One remark ad codepage here (as Strings in Java are always codepage related): if there is UTF-16 or UTF-32 text exchanged then it may be the case that LF and CR-LF characters are not correct. Here a rexxtry session:

   call bsf.cls
      ........................................... rexxtry.rex on WindowsNT
   lf="0d0a"x;a="one"lf"two";say a; say a~c2x
   one
   two
   6F6E65*0D0A*74776F
      ........................................... rexxtry.rex on WindowsNT
   b=bsf.iconv(a, "CP437", "UTF-16")
      ........................................... rexxtry.rex on WindowsNT
   say b;say b~c2x
       o n e
     t w o
   FEFF006F006E0065*000D000A*00740077006F
      ........................................... rexxtry.rex on WindowsNT
   d=bsf.iconv(a, "CP437", "UTF-32")
      ........................................... rexxtry.rex on WindowsNT
   say d;say d~c2x
       o   n   e
       t   w   o
   0000006F0000006E00000065*0000000D0000000A*00000074000000770000006F
      ........................................... rexxtry.rex on WindowsNT

With UTF-8 this would not be a problem:

   say c;say c~c2x
   one
   two
   6F6E65*0D0A*74776F
      ........................................... rexxtry.rex on WindowsNT

---

Would you think it to be feasible at this time to have also "raw" versions like ReadInputBufferRaw, WriteOutputBufferRaw, WriteErrorBufferRaw such that one could process and produce binary data exploiting the new redirecting command handlers?

---rony



On Thu, Aug 18, 2022 at 6:01 AM Rony G. Flatscher <rony.flatsc...@wu.ac.at> 
wrote:

    The Write{Output|Error}Buffer API states:

        Adds a string composed of strings separated by the platform-specfic 
line-end characters as
        separate
        items or lines to an output redirection Rexx object that was specified 
using the WITH
        subkeyword of
        an ADDRESS instruction.

    Is there any processing done on the received data or does the 
Write{Output|Error}Buffer-API
    just take the receive data as is and place it as a single item to the 
output sink? In this
    case it would become possible to produce binary data as a result of a 
command (and will
    motivate the need of an additional API on the Java side to become able to 
distinguish between
    Strings (Reader,Writer, codepage dependent) and Streams (byte oriented, raw 
data)).

    ---rony

_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to