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

(7.0.3) writing a large(?) string to stdout is mangled #4266

Open
dalehenrich opened this issue Aug 9, 2019 · 3 comments

Comments

@dalehenrich
Copy link

commented Aug 9, 2019

running the following expression in Pharo7.0.3:

(ZnCharacterWriteStream
		on: Stdio stdout
		encoding: ZnCharacterEncoder utf8)
 nextPutAll: 'NAME
	about.st - Provide detailed information about the image that this script is running in....

SYNOPSIS
	about.st [ [ <image-name> ] [-H] [-D] [-V] [ <st-vm-args> ] -- ]  <script options>
----------
	about.st [ -h | --help ] [ --imageProperties ]

DESCRIPTION
	Provide detailed information about the image that this script is running in
	return a dictionary with fields for all sorts of interesting information 
	not recorded in image properties file (--imageProperties)

	--help
		display this message

	--imageProperties
		return (on objOut) the image properties object for the image running
		this script


	<image-name>
		name of the st_launcher image to be used to run the script. If
		no <image-name> is specified the default image will be used.

	-H
		help. st_launcher script interpreter help message

	-D
		debug. bring up debugger if an error occurs while running script

	-V
		verbose. display more detail about script interpreter execution

	<st-vm-args>
		smalltalk vm specific arguments passed directly to vm when launching script

EXAMPLES
	about.st -h
	about.st --help
	about.st --imageProperties

	about.st pharo -- --imageProperties

	about.st

SEE ALSO
	
	
'

produces the following output on my terminal:

DESCRIPT<st-vm-asmalltalk vm specific arguments passed directly to v^Cexecutiontningtions>g in....

which is a bit disappointing ... inspecting the string (as copied from this report) I see a bunch of Character cr .... the original string as produced by my code uses Character lf and it fares a bit better, but is still corrupted:

NAME
	about.st - Provide detailed information about the image that this script is running in....

SYNOPSIS
--------about.st [ -h | --help ] [ --imageProperties ]st-vm-args> ] -- ]  <script options>

DESCRIPTION
	<st-vm-asmalltalk vm specific arguments passed directly to vm when launching script

EXAMPLES
	about.st pharo -- --imageProperties

SEE ALSO
	
	

what is going on here? ... in GemStone, I don't have this problem :(.

@dalehenrich

This comment has been minimized.

Copy link
Author

commented Aug 9, 2019

I'm running on Ubunutu 16.04 and useing x windows ...

@Ducasse

This comment has been minimized.

Copy link
Member

commented Aug 10, 2019

Hi dale

you should send this to the mailing-list because not everybody is systematically reading the bug entry.

Stef

@akgrant43

This comment has been minimized.

Copy link
Collaborator

commented Aug 10, 2019

Hi Dale,

Pharo still uses CR as the line terminator (while Unix is of course LF). Replace the start of your expression with:

(ZnNewLineWriterStream on: (ZnCharacterWriteStream
		on: Stdio stdout
		encoding: ZnCharacterEncoder utf8))

:-)
Alistair

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.