Strange source import behaviour ..

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

Strange source import behaviour ..

Gemstone/S mailing list

Using my modelling tool I created the following source code (an extract). Please notice how the source code has changed within the database ($- is converted to hB) . The source code is imported via a topaz script:

%
category: 'framework-indices'
set compile_env: 0
method: ES3APIElection
removeIndices

    " Generator: 'Topaz/Gemstone (REST Server Smalltalk)' Version: '08.06.02-02.05.17' LastRun: '2015_12_19_10_24_04' "
    " Model-Version: '1.1.115'  "


%
category: 'model-json-support'
set compile_env: 0
classmethod: ES3APIElection
pumSimpleSwaggerModelNeoJsonMapping: mapping

    " Generator: 'Topaz/Gemstone (REST Server Smalltalk)' Version: '08.06.02-02.05.17' LastRun: '2015_12_19_10_24_04' "
    " Model-Version: '1.1.115'  "


    mapping
        mapProperty: #electionDate
        getter: [ :object | | value | ((value := object getElectionDate) ~= UndefinedObject and:[ value isNil not ]) ifTrue: [ value asStringUsingFormat: #(3 2 1 $-  1 1 ) ] ifFalse:[ nil ]]
        setter: [ :object :value | value ifNotNil:[ object setElectionDate: (Date fromString: value usingFormat: #(3 2 1 $-  1 1 )) ]].
   

... rest ist left out ...


%


the bold printed stuff is imported as:


    mapping
        mapProperty: #electionDate
        getter: [ :object | | value | ((value := object getElectionDate) ~= UndefinedObject and:[ value isNil not ]) ifTrue: [ value asStringUsingFormat: #(3 2 1 hB  1 1 ) ] ifFalse:[ nil ]]
        setter: [ :object :value | value ifNotNil:[ object setElectionDate: (Date fromString: value usingFormat: #(3 2 1 hB  1 1 )) ]].


_______________________________________________
GemStone-Smalltalk mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Strange source import behaviour ..

Gemstone/S mailing list
Marten,

I am suspicious that this is a UTF-8 encoding issue. Use a binary editor and see how the $- bytes are actually encoded in the file. 16r2D shouldn't be encoded, but ....

If it is a UTF-8 encoded character, you would have the wrong character (pasted from a word processor or other source?).


As an aside, if you do have UTF-8 encoded characters in a file-out, start the file-in with the line FILEFORMAT UTF-8. (The default for Topaz is 8BIT.)

Richard




On Sat, Dec 19, 2015 at 6:52 AM, Marten Feldtmann via GemStone-Smalltalk <[hidden email]> wrote:

Using my modelling tool I created the following source code (an extract). Please notice how the source code has changed within the database ($- is converted to hB) . The source code is imported via a topaz script:

%
category: 'framework-indices'
set compile_env: 0
method: ES3APIElection
removeIndices

    " Generator: 'Topaz/Gemstone (REST Server Smalltalk)' Version: '08.06.02-02.05.17' LastRun: '2015_12_19_10_24_04' "
    " Model-Version: '1.1.115'  "


%
category: 'model-json-support'
set compile_env: 0
classmethod: ES3APIElection
pumSimpleSwaggerModelNeoJsonMapping: mapping

    " Generator: 'Topaz/Gemstone (REST Server Smalltalk)' Version: '08.06.02-02.05.17' LastRun: '2015_12_19_10_24_04' "
    " Model-Version: '1.1.115'  "


    mapping
        mapProperty: #electionDate
        getter: [ :object | | value | ((value := object getElectionDate) ~= UndefinedObject and:[ value isNil not ]) ifTrue: [ value asStringUsingFormat: #(3 2 1 $-  1 1 ) ] ifFalse:[ nil ]]
        setter: [ :object :value | value ifNotNil:[ object setElectionDate: (Date fromString: value usingFormat: #(3 2 1 $-  1 1 )) ]].
   

... rest ist left out ...


%


the bold printed stuff is imported as:


    mapping
        mapProperty: #electionDate
        getter: [ :object | | value | ((value := object getElectionDate) ~= UndefinedObject and:[ value isNil not ]) ifTrue: [ value asStringUsingFormat: #(3 2 1 hB  1 1 ) ] ifFalse:[ nil ]]
        setter: [ :object :value | value ifNotNil:[ object setElectionDate: (Date fromString: value usingFormat: #(3 2 1 hB  1 1 )) ]].


_______________________________________________
GemStone-Smalltalk mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk



_______________________________________________
GemStone-Smalltalk mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk