Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nano untagged files #11

Open
gngrossi opened this issue Mar 12, 2024 · 5 comments
Open

nano untagged files #11

gngrossi opened this issue Mar 12, 2024 · 5 comments

Comments

@gngrossi
Copy link

Will untagged files be supported?
thanks

@gngrossi
Copy link
Author

bash-5.2$ /bin/touch OP

bash-5.2$ ls -lT OP

  • untagged T=off -rw-r--r-- 1 @02858 @ISSTC00 0 Mar 13 10:10 OP

bash-5.2$ /bin/echo hello >> OP

bash-5.2$ ls -lrtT OP

  • untagged T=off -rw-r--r-- 1 @02858 @ISSTC00 6 Mar 13 10:10 OP

bash-5.2$ /bin/cat OP
hello

bash-5.2$ nano OP
GNU nano 7.2 OP
^h^e^s^s^v^U

@mfsysprog
Copy link
Collaborator

mfsysprog commented Mar 25, 2024

Nano relies on the heuristic in zoslib to decide if untagged files contain ascii or ebcdic. This requires a minimum of 8 positions of data to be able to see if it is ebcdic. The only solution at the moment is to have 8 characters or more of ebcdic data in the file or tag the file as ibm-1047 before editing.
Also, at the moment untagged files are always saved as ascii. I'm planning to fix this, but it is really difficult to do that from zoslib where it would benifit all tools.

@gngrossi
Copy link
Author

Thanks for the update.
Would you be taking the same approach as with vim? (using export __UNTAGGED_READ_MODE=ASCII)

@IgorTodorovskiIBM
Copy link
Contributor

Thanks for the update. Would you be taking the same approach as with vim? (using export __UNTAGGED_READ_MODE=ASCII)

Nano should respect that environment variable since it's also built with zoslib.

We could probably improve the heuristic though. The cnt > 8 check (https://github.com/ibmruntimes/zoslib/blob/main/src/zos-char-util.cc#L541) is an arbitrary check.

@gngrossi
Copy link
Author

Do you plan to first have nano work like vim and then improve the heuristic?
thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants