[squeak-dev] The Inbox: Multilingual-ul.132.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Dec 26 02:22:29 UTC 2010


A new version of Multilingual was added to project The Inbox:
http://source.squeak.org/inbox/Multilingual-ul.132.mcz

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

Name: Multilingual-ul.132
Author: ul
Time: 26 December 2010, 3:20:10.93 am
UUID: 0b8c3ee1-0be4-4d42-b27c-8741c30a20f9
Ancestors: Multilingual-ul.131

- stdio streams are now MultiByteFileStreams, instead of CrLfFileStreams, therefore #openOnHandle:name:forWrite: now sets the lineEndConvention and the converter properly
- some tweaks about converter accessing

=============== Diff against Multilingual-ul.131 ===============

Item was changed:
  ----- Method: MultiByteFileStream>>bareNext (in category 'crlf private') -----
  bareNext
  
+ 	 ^converter nextFromStream: self.
- 	 ^ self converter nextFromStream: self.
  !

Item was changed:
  ----- Method: MultiByteFileStream>>converter (in category 'accessing') -----
  converter
  
+ 	^converter ifNil: [
+ 		self converter: TextConverter defaultSystemConverter.
+ 		converter ]!
- 	converter ifNil: [self converter: TextConverter defaultSystemConverter].
- 	^ converter
- !

Item was changed:
  ----- Method: MultiByteFileStream>>nextPut: (in category 'public') -----
  nextPut: aCharacter
  
  	aCharacter isInteger ifTrue: [ ^super nextPut: aCharacter ].
  	(wantsLineEndConversion == true and: [ lineEndConvention notNil ]) "#doConversion is inlined here"
  		 ifTrue: [
+ 			aCharacter == Cr
- 			aCharacter = Cr
  				ifTrue: [
+ 					converter 
+ 						nextPutAll: (LineEndStrings at: lineEndConvention)
+ 						toStream: self ]
- 					(LineEndStrings at: lineEndConvention) do: [ :each |
- 						converter nextPut: each toStream: self ] ]
  				ifFalse: [ 
  					converter nextPut: aCharacter toStream: self ].
  			^aCharacter ].
+ 	converter nextPut: aCharacter toStream: self.
+ 	^aCharacter!
- 	self converter nextPut: aCharacter toStream: self.
- 	^aCharacter
- !

Item was changed:
  ----- Method: MultiByteFileStream>>nextPutAll: (in category 'public') -----
  nextPutAll: aCollection
  
  	(self isBinary or: [aCollection class == ByteArray]) ifTrue: [
  		^ super nextPutAll: aCollection.
  	].
+ 	converter nextPutAll: aCollection toStream: self.
- 	self converter nextPutAll: aCollection toStream: self.
  	^aCollection!

Item was changed:
  ----- Method: MultiByteFileStream>>openOnHandle:name:forWrite: (in category 'open/close') -----
  openOnHandle: aFileID name: streamName forWrite: writeMode
+ 	"Use crlf as line end convention on windows, lf on all other platforms. Also make sure that the converter is initialized."
  
+ 	| theLineEndConvention |
  	super openOnHandle: aFileID name: streamName forWrite: writeMode.
+ 	theLineEndConvention := self class lineEndDefault.
+ 	theLineEndConvention == #crlf ifFalse: [
+ 		theLineEndConvention := #lf ].
+ 	self
+ 		lineEndConvention: theLineEndConvention;
+ 		converter!
- 	self converter "Make sure that converter is initialized."!

Item was changed:
  ----- Method: MultiByteFileStream>>setConverterForCode (in category 'private') -----
  setConverterForCode
  
  	| current |
  	(SourceFiles at: 2)
  		ifNotNil: [self fullName = (SourceFiles at: 2) fullName ifTrue: [^ self]].
+ 	current := converter saveStateOf: self.
- 	current := self converter saveStateOf: self.
  	self position: 0.
  	self binary.
  	((self next: 3) = #[ 16rEF 16rBB 16rBF ]) ifTrue: [
  		self converter: UTF8TextConverter new
  	] ifFalse: [
  		self converter: MacRomanTextConverter new.
  	].
  	converter restoreStateOf: self with: current.
  	self text.
  !




More information about the Squeak-dev mailing list