And if you want to have 100% control over decoding, you can do as follows:

(FileLocator desktop / 'test1utf8_cut2.csv') binaryReadStreamDo: [ :in |
   (NeoCSVReader on: (ZnCharacterReadStream on: in)) separator: $; ; upToEnd ].

(FileLocator desktop / 'test1utf8_cut2.csv') binaryReadStreamDo: [ :in |
   (NeoCSVReader on: (ZnCharacterReadStream on: in encoding: #utf8)) separator: 
$; ; upToEnd ].

See also,

https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/lastSuccessfulBuild/artifact/book-result/Zinc-Encoding-Meta/Zinc-Encoding-Meta.html

Part of books.pharo.org (http://files.pharo.org/books/enterprise-pharo/)

> On 14 Nov 2016, at 09:55, Robert Kuszinger <kuszin...@giscom.hu> wrote:
> 
> Hello,
> 
> I've trying to play around with Roassal so I load a csv.
> 
> Code by far is here:
> 
> 
> |csv mbfs cont|
> 
> 
> mbfs := FileStream fileNamed: 
> 'C:\Users\kusr\Documents\vis\test1utf8_cut2.csv'.
> mbfs 
>     lineEndConvention: #crlf;
>     converter: UTF8TextConverter new. 
> cont := mbfs contents.
> 
> 
> In the contents message the following happens:
> 
> Array(Object)>>primitiveFailed:
> Array(Object)>>primitiveFailed
> Array>>elementsForwardIdentityTo:
> ByteString(Object)>>becomeForward:
> ByteString>>at:put:
> MultiByteFileStream>>next:
> MultiByteFileStream(FileStream)>>contents
> UndefinedObject>>DoIt
> OpalCompiler>>evaluate
> RubSmalltalkEditor>>evaluate:andDo:
> RubSmalltalkEditor>>highlightEvaluateAndDo:
> [ textMorph textArea editor highlightEvaluateAndDo: ann action.
> textMorph shoutStyler style: textMorph text ] in [ textMorph textArea
>     handleEdit: [ textMorph textArea editor highlightEvaluateAndDo: ann 
> action.
>         textMorph shoutStyler style: textMorph text ] ] in 
> GLMMorphicPharoScriptRenderer(GLMMorphicPharoCodeRenderer)>>actOnHighlightAndEvaluate:
>  in Block: [ textMorph textArea editor highlightEvaluateAndDo...etc...
> RubEditingArea(RubAbstractTextArea)>>handleEdit:
> [ textMorph textArea
>     handleEdit: [ textMorph textArea editor highlightEvaluateAndDo: ann 
> action.
>         textMorph shoutStyler style: textMorph text ] ] in 
> GLMMorphicPharoScriptRenderer(GLMMorphicPharoCodeRenderer)>>actOnHighlightAndEvaluate:
>  in Block: [ textMorph textArea...
> WorldState>>runStepMethodsIn:
> WorldMorph>>runStepMethods
> WorldState>>doOneCycleNowFor:
> WorldState>>doOneCycleFor:
> WorldState>>doOneSubCycleFor:
> WorldMorph>>doOneSubCycle
> MenuMorph>>invokeModalAt:in:allowKeyboard:
> MenuMorph>>invokeModal:
> MenuMorph>>invokeModal
> [ :menu | 
> menu setInvokingView: self editor.
> menu invokeModal.
> self changed.
> ^ true ] in RubEditingArea(RubAbstractTextArea)>>yellowButtonActivity: in 
> Block: [ :menu | ...
> MenuMorph(Object)>>ifNotNilDo:
> RubEditingArea(RubAbstractTextArea)>>yellowButtonActivity:
> RubEditingArea(RubAbstractTextArea)>>mouseDown:
> RubEditingArea(Morph)>>handleMouseDown:
> MouseButtonEvent>>sentTo:
> RubEditingArea(Morph)>>handleEvent:
> 
> 
> 
> HERE:  (ByteString at:put:)
> 
> ...
>     aCharacter isOctetCharacter ifFalse:[
>         "Convert to WideString"
>         self becomeForward: (WideString from: self).
>         ^self at: index put: aCharacter.
> ...
> 
> Image is 
> 
> moose_suite_6_0 on windows.
> 
> What should I do? What is frightening that I linked file and SOMETIMES
> it raises the error above and sometimes not... ???
> 
> (zip file with sample csv...)
> 
> https://drive.google.com/file/d/0B0JASZM9_9QqX19JZElwMVVXWjA/view?usp=sharing
> 
> thanks
> Robert
> 
> 
> 
> 


Reply via email to