Frank Shearar uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-fbs.542.mcz
==================== Summary ====================
Name: System-fbs.542
Author: fbs
Time: 2 June 2013, 5:51:01.516 pm
UUID: c48f768f-3538-4bd2-8589-017a8457aa72
Ancestors: System-nice.541
PartsBin and friends already have #localeChanged implementations.
I don't know if "self class environment" is the right thing here. I don't want to use Smalltalk globals. Perhaps the right thing is to say "self environment" where #environment may be set, or defaults to Smalltalk globals.
Object >> #localeChanged moved here because it's a localisation thing, and because I'd rather have System depend on Kernel than Kernel depend on System.
=============== Diff against System-nice.541 ===============
Item was changed:
----- Method: Locale class>>localeChanged (in category 'notification') -----
localeChanged
+ self class environment allBehaviorsDo: [:b | b localeChanged].!
-
- #(#ParagraphEditor #BitEditor #FormEditor #StandardSystemController )
- do: [:key | Smalltalk
- at: key
- ifPresent: [:class | class initialize]].
- PartsBin localeChanged.
- Project localeChanged.
- PaintBoxMorph localeChanged.
- ColorPickerMorph localeChanged.
- Preferences localeChanged!
Item was changed:
----- Method: Locale class>>localeChangedGently (in category 'notification') -----
localeChangedGently
+ self class environment allBehaviorsDo: [:b | b localeChangedGently].!
-
- #(#ParagraphEditor #BitEditor #FormEditor #StandardSystemController )
- do: [:key | Smalltalk
- at: key
- ifPresent: [:class | class initialize]].
- PartsBin localeChangedGently.
- Project localeChangedGently.
- PaintBoxMorph localeChangedGently.
- ColorPickerMorph localeChangedGently.
- Preferences localeChangedGently.
- !
Item was added:
+ ----- Method: Object>>localeChanged (in category '*System-Localization-locales') -----
+ localeChanged
+ self shouldBeImplemented!
Item was added:
+ ----- Method: Object>>localeChangedGently (in category '*System-Localization-locales') -----
+ localeChangedGently
+ self localeChanged.!
Nicolas Cellier uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-nice.541.mcz
==================== Summary ====================
Name: System-nice.541
Author: nice
Time: 2 June 2013, 6:46:07.394 pm
UUID: c37330b6-d436-4f84-880f-8b77f2c970e6
Ancestors: System-fbs.540
Let MczInstaller know that .mcz text files are encoded in utf8.
=============== Diff against System-fbs.540 ===============
Item was added:
+ ----- Method: MczInstaller>>contentsForMember: (in category 'private') -----
+ contentsForMember: member
+ ^[(member contentStreamFromEncoding: 'utf8') text contents] on: InvalidUTF8
+ do: [:exc |
+ "Case of legacy encoding, presumably it is latin-1.
+ But if contents starts with a null character, it might be a case of WideString encoded in UTF-32BE"
+ | str |
+ str := (member contentStreamFromEncoding: 'latin1') text..
+ exc return: ((str peek = Character null and: [ str size \\ 4 = 0 ])
+ ifTrue: [WideString fromByteArray: str contents asByteArray]
+ ifFalse: [str contents])]!
Item was changed:
----- Method: MczInstaller>>installMember: (in category 'installation') -----
installMember: member
self useNewChangeSetDuring:
+ [ | contents |
+ contents := self contentsForMember: member.
+ contents readStream fileInAnnouncing: 'loading ', member fileName.
+ ]!
- [ | str |
- str := member contentStream text readStream contents.
- str := [str utf8ToSqueak] on: InvalidUTF8 do: [:exc |
- "Case of legacy encoding, presumably it is latin-1 and we do not need to do anything
- But if contents starts with a null character, it might be a case of WideString encoded in UTF-32BE"
- exc return: (((str beginsWith: Character null asString) and: [ str size \\ 4 = 0 ])
- ifTrue: [WideString fromByteArray: str asByteArray]
- ifFalse: [str])].
- str readStream fileInAnnouncing: 'loading ', member fileName ]!
Item was changed:
----- Method: MczInstaller>>parseMember: (in category 'utilities') -----
+ parseMember: memberOrName
+ | member contents tokens |
+ member := self zip member: memberOrName.
+ contents := self contentsForMember: member.
+ tokens := (self scanner scanTokens: contents) first.
- parseMember: fileName
- | tokens |
- tokens := (self scanner scanTokens: (zip contentsOf: fileName)) first.
^ self associate: tokens!
Nicolas Cellier uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-nice.541.mcz
==================== Summary ====================
Name: System-nice.541
Author: nice
Time: 2 June 2013, 6:46:07.394 pm
UUID: c37330b6-d436-4f84-880f-8b77f2c970e6
Ancestors: System-fbs.540
Let MczInstaller know that .mcz text files are encoded in utf8.
=============== Diff against System-fbs.540 ===============
Item was added:
+ ----- Method: MczInstaller>>contentsForMember: (in category 'private') -----
+ contentsForMember: member
+ ^[(member contentStreamFromEncoding: 'utf8') text contents] on: InvalidUTF8
+ do: [:exc |
+ "Case of legacy encoding, presumably it is latin-1.
+ But if contents starts with a null character, it might be a case of WideString encoded in UTF-32BE"
+ | str |
+ str := (member contentStreamFromEncoding: 'latin1') text..
+ exc return: ((str peek = Character null and: [ str size \\ 4 = 0 ])
+ ifTrue: [WideString fromByteArray: str contents asByteArray]
+ ifFalse: [str contents])]!
Item was changed:
----- Method: MczInstaller>>installMember: (in category 'installation') -----
installMember: member
self useNewChangeSetDuring:
+ [ | contents |
+ contents := self contentsForMember: member.
+ contents readStream fileInAnnouncing: 'loading ', member fileName.
+ ]!
- [ | str |
- str := member contentStream text readStream contents.
- str := [str utf8ToSqueak] on: InvalidUTF8 do: [:exc |
- "Case of legacy encoding, presumably it is latin-1 and we do not need to do anything
- But if contents starts with a null character, it might be a case of WideString encoded in UTF-32BE"
- exc return: (((str beginsWith: Character null asString) and: [ str size \\ 4 = 0 ])
- ifTrue: [WideString fromByteArray: str asByteArray]
- ifFalse: [str])].
- str readStream fileInAnnouncing: 'loading ', member fileName ]!
Item was changed:
----- Method: MczInstaller>>parseMember: (in category 'utilities') -----
+ parseMember: memberOrName
+ | member contents tokens |
+ member := self zip member: memberOrName.
+ contents := self contentsForMember: member.
+ tokens := (self scanner scanTokens: contents) first.
- parseMember: fileName
- | tokens |
- tokens := (self scanner scanTokens: (zip contentsOf: fileName)) first.
^ self associate: tokens!
Nicolas Cellier uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-nice.541.mcz
==================== Summary ====================
Name: System-nice.541
Author: nice
Time: 2 June 2013, 6:46:07.394 pm
UUID: c37330b6-d436-4f84-880f-8b77f2c970e6
Ancestors: System-fbs.540
Let MczInstaller know that .mcz text files are encoded in utf8.
=============== Diff against System-fbs.540 ===============
Item was added:
+ ----- Method: MczInstaller>>contentsForMember: (in category 'private') -----
+ contentsForMember: member
+ ^[(member contentStreamFromEncoding: 'utf8') text contents] on: InvalidUTF8
+ do: [:exc |
+ "Case of legacy encoding, presumably it is latin-1.
+ But if contents starts with a null character, it might be a case of WideString encoded in UTF-32BE"
+ | str |
+ str := (member contentStreamFromEncoding: 'latin1') text..
+ exc return: ((str peek = Character null and: [ str size \\ 4 = 0 ])
+ ifTrue: [WideString fromByteArray: str contents asByteArray]
+ ifFalse: [str contents])]!
Item was changed:
----- Method: MczInstaller>>installMember: (in category 'installation') -----
installMember: member
self useNewChangeSetDuring:
+ [ | contents |
+ contents := self contentsForMember: member.
+ contents readStream fileInAnnouncing: 'loading ', member fileName.
+ ]!
- [ | str |
- str := member contentStream text readStream contents.
- str := [str utf8ToSqueak] on: InvalidUTF8 do: [:exc |
- "Case of legacy encoding, presumably it is latin-1 and we do not need to do anything
- But if contents starts with a null character, it might be a case of WideString encoded in UTF-32BE"
- exc return: (((str beginsWith: Character null asString) and: [ str size \\ 4 = 0 ])
- ifTrue: [WideString fromByteArray: str asByteArray]
- ifFalse: [str])].
- str readStream fileInAnnouncing: 'loading ', member fileName ]!
Item was changed:
----- Method: MczInstaller>>parseMember: (in category 'utilities') -----
+ parseMember: memberOrName
+ | member contents tokens |
+ member := self zip member: memberOrName.
+ contents := self contentsForMember: member.
+ tokens := (self scanner scanTokens: contents) first.
- parseMember: fileName
- | tokens |
- tokens := (self scanner scanTokens: (zip contentsOf: fileName)) first.
^ self associate: tokens!
Nicolas Cellier uploaded a new version of Compression to project The Trunk:
http://source.squeak.org/trunk/Compression-nice.32.mcz
==================== Summary ====================
Name: Compression-nice.32
Author: nice
Time: 2 June 2013, 3:15:05.134 pm
UUID: bce2a55c-891e-4fee-bce4-d8a12461b792
Ancestors: Compression-ul.31
Add a utility #contentStreamFromEncoding: to decode some ZipArchiveMember with prescribed encoding ('latin1', 'utf8' etc...)
=============== Diff against Compression-ul.31 ===============
Item was changed:
----- Method: ZipArchiveMember>>contentStream (in category 'accessing') -----
contentStream
"Answer my contents as a text stream.
Default is no conversion, since we don't know what the bytes mean."
+ ^self contentStreamFromEncoding: 'latin1'
- | s |
- s := MultiByteBinaryOrTextStream on: (String new: self uncompressedSize).
- s converter: Latin1TextConverter new.
- self extractTo: s.
- s reset.
- ^ s.
!
Item was added:
+ ----- Method: ZipArchiveMember>>contentStreamFromEncoding: (in category 'accessing') -----
+ contentStreamFromEncoding: encodingName
+ "Answer my contents as a text stream.
+ Interpret the raw bytes with given encodingName"
+
+ | s |
+ s := MultiByteBinaryOrTextStream on: (String new: self uncompressedSize).
+ s converter: (TextConverter newForEncoding: encodingName).
+ self extractTo: s.
+ s reset.
+ ^ s
+ !
Nicolas Cellier uploaded a new version of Compression to project The Trunk:
http://source.squeak.org/trunk/Compression-nice.32.mcz
==================== Summary ====================
Name: Compression-nice.32
Author: nice
Time: 2 June 2013, 3:15:05.134 pm
UUID: bce2a55c-891e-4fee-bce4-d8a12461b792
Ancestors: Compression-ul.31
Add a utility #contentStreamFromEncoding: to decode some ZipArchiveMember with prescribed encoding ('latin1', 'utf8' etc...)
=============== Diff against Compression-ul.31 ===============
Item was changed:
----- Method: ZipArchiveMember>>contentStream (in category 'accessing') -----
contentStream
"Answer my contents as a text stream.
Default is no conversion, since we don't know what the bytes mean."
+ ^self contentStreamFromEncoding: 'latin1'
- | s |
- s := MultiByteBinaryOrTextStream on: (String new: self uncompressedSize).
- s converter: Latin1TextConverter new.
- self extractTo: s.
- s reset.
- ^ s.
!
Item was added:
+ ----- Method: ZipArchiveMember>>contentStreamFromEncoding: (in category 'accessing') -----
+ contentStreamFromEncoding: encodingName
+ "Answer my contents as a text stream.
+ Interpret the raw bytes with given encodingName"
+
+ | s |
+ s := MultiByteBinaryOrTextStream on: (String new: self uncompressedSize).
+ s converter: (TextConverter newForEncoding: encodingName).
+ self extractTo: s.
+ s reset.
+ ^ s
+ !
Nicolas Cellier uploaded a new version of Compression to project The Trunk:
http://source.squeak.org/trunk/Compression-nice.32.mcz
==================== Summary ====================
Name: Compression-nice.32
Author: nice
Time: 2 June 2013, 3:15:05.134 pm
UUID: bce2a55c-891e-4fee-bce4-d8a12461b792
Ancestors: Compression-ul.31
Add a utility #contentStreamFromEncoding: to decode some ZipArchiveMember with prescribed encoding ('latin1', 'utf8' etc...)
=============== Diff against Compression-ul.31 ===============
Item was changed:
----- Method: ZipArchiveMember>>contentStream (in category 'accessing') -----
contentStream
"Answer my contents as a text stream.
Default is no conversion, since we don't know what the bytes mean."
+ ^self contentStreamFromEncoding: 'latin1'
- | s |
- s := MultiByteBinaryOrTextStream on: (String new: self uncompressedSize).
- s converter: Latin1TextConverter new.
- self extractTo: s.
- s reset.
- ^ s.
!
Item was added:
+ ----- Method: ZipArchiveMember>>contentStreamFromEncoding: (in category 'accessing') -----
+ contentStreamFromEncoding: encodingName
+ "Answer my contents as a text stream.
+ Interpret the raw bytes with given encodingName"
+
+ | s |
+ s := MultiByteBinaryOrTextStream on: (String new: self uncompressedSize).
+ s converter: (TextConverter newForEncoding: encodingName).
+ self extractTo: s.
+ s reset.
+ ^ s
+ !