[squeak-dev] The Trunk: Multilingual-tonyg.218.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Aug 31 13:29:43 UTC 2017

Patrick Rein uploaded a new version of Multilingual to project The Trunk:

==================== Summary ====================

Name: Multilingual-tonyg.218
Author: tonyg
Time: 23 February 2017, 2:13:59.45456 pm
UUID: 86e12680-7d6d-400c-8215-62a8315f01f1
Ancestors: Multilingual-tfel.217

Override PositionableStream>>#upToPosition:, introduced in Collections-tonyg.734, in order to reflect the fact that positions count bytes here; previously, #next: was being used, but that method expects a count of characters, not bytes. This is the second half of a fix for Mantis #4665. See also MultilingualTests-tonyg.22.

=============== Diff against Multilingual-tfel.217 ===============

Item was added:
+ ----- Method: MultiByteFileStream>>upToPosition: (in category 'accessing') -----
+ upToPosition: anInteger
+ 	"Answer a subcollection containing items starting from the current position and ending including the given position. Usefully different to #next: in that positions measure *bytes* from the file, where #next: wants to measure *characters*."
+ 	^self collectionSpecies new: 1000 streamContents: [ :stream |
+ 		| ch |
+ 		[ (ch := self next) == nil or: [ position > anInteger ] ] 
+ 			whileFalse: [ stream nextPut: ch ] ]!

More information about the Squeak-dev mailing list