The Trunk: Multilingual-tonyg.218.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Multilingual-tonyg.218.mcz

commits-2
Patrick Rein uploaded a new version of Multilingual to project The Trunk:
http://source.squeak.org/trunk/Multilingual-tonyg.218.mcz

==================== 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 ] ]!