开发者

In J, 1!:2&4 replaces LF with CRLF. Is there a way to keep it as LF?

开发者 https://www.devze.com 2023-03-25 07:00 出处:网络
I have a modified boot.ijs script for J which allows J to respond to a request from Apache. Essentially, in httpd.conf, I have this:

I have a modified boot.ijs script for J which allows J to respond to a request from Apache.

Essentially, in httpd.conf, I have this:

ScriptAlias /j/ "C:/J/"
DirectoryIndex index.ijs
AddType application/x-httpd-ijs .ijs
Action application/x-httpd-ijs "/j/j.exe开发者_JS百科"

Which tells Apache to send all *.ijs urls to J. That's just here for the context.

J can then answer by writing to the standard output with:

echo =: 1!:2&4

I have binary data (an Excel file) that I create, then want to send back to the asker's browser, such as detailed here. However, in the file itself, all LF's are changed to CRLF.

This behaviour can be "observed" in jconsole.exe. Type in the declaration for echo above, and send the commands:

echo LF
echo CR
echo LF

You will see that there's one more line after each echo LF, because in the console CR is just written as a single line. In essence, J translates LF to CRLF.

The question: How do you turn it off, make J respect what is actually asked to be outputted?


Learned from their forum that J always outputs as text, never as binary, which means LF is always going to be replaced with CRLF. Huge disappointment.

0

精彩评论

暂无评论...
验证码 换一张
取 消