Some errors

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

Some errors

dario trussardi
Hi,

i work with GLASS 1.0-beta.9


I found two problem:

A) Into GLASS when i have a string with the character €

' dario € ' asString 

the system erase the error :

_compileInContext: anObject symbolList: aSymbolList "Returns a GsMethod that is not in the method dictionary of any class, or else generates an error if there are compilation errors." <primitive: 150> aSymbolList _validateClass: SymbolList . ^ self _primitiveFailed: #_compileInContext:symbolList:



B) the '.' split: 'www.dariospizza.com' into GLASS d'ont work.

it return a array with one empty string.


in Pharo it return a array with 3 elements.


Thank,

Dario
Reply | Threaded
Open this post in threaded view
|

Re: Some errors

Dale Henrichs
Dario Trussardi wrote:

> Hi,
>
> i work with GLASS 1.0-beta.9
>
>
> I found two problem:
>
> A) Into GLASS when i have a string with the character €
>
> ' dario € ' asString
>
> the system erase the error :
>
> _compileInContext: anObject symbolList: aSymbolList "Returns a GsMethod
> that is not in the method dictionary of any class, or else generates an
> error if there are compilation errors." <primitive: 150> aSymbolList
> _validateClass: SymbolList . ^ self _primitiveFailed:
> #_compileInContext:symbolList:
>
>
> *
> *
> *B) the '.' split: 'www.dariospizza.com' into GLASS d'ont work. *
> *
> *
> * it return a array with one empty string.*
> *
> *
> *
> *
> * in Pharo it return a array with 3 elements.*
>
>
> Thank,
>
> Dario

Dario,

Regarding ' dario € '. In 2.4.4.1, the source for compilation must be
either a String or DoubleByteString .... To work with multibyte
characters, I tend to work with ByteArrays that contain the UTF8
encoding for the string, and send #decodeFromUTF8 to create my multibyte
strings.


The split issue is covered by Issue 52
(http://code.google.com/p/glassdb/issues/detail?id=52) not fixed ... I
haven't gotten around to resolving the #split: issue, but apparently it
is/was used in other parts of GLASS ...


Reply | Threaded
Open this post in threaded view
|

Re: Some errors

dario trussardi
Hi,


> Dario Trussardi wrote:
>> Hi,
>> i work with GLASS 1.0-beta.9
>> I found two problem:
>> A) Into GLASS when i have a string with the character €
>> ' dario € ' asString the system erase the error :
>> _compileInContext: anObject symbolList: aSymbolList "Returns a GsMethod that is not in the method dictionary of any class, or else generates an error if there are compilation errors." <primitive: 150> aSymbolList _validateClass: SymbolList . ^ self _primitiveFailed: #_compileInContext:symbolList:
>> *
>> *
>> *B) the '.' split: 'www.dariospizza.com' into GLASS d'ont work. *
>> *
>> *
>> * it return a array with one empty string.*
>> *
>> *
>> *
>> *
>> * in Pharo it return a array with 3 elements.*
>> Thank,
>> Dario
>
> Dario,
>
> Regarding ' dario € '. In 2.4.4.1, the source for compilation must be either a String or DoubleByteString .... To work with multibyte characters, I tend to work with ByteArrays that contain the UTF8 encoding for the string, and send #decodeFromUTF8 to create my multibyte strings.
>

Anyone have example about it ?

I'm interested to manage PRPage where contents:

        include  'string' with the € .

For example

        thirdColon
        ^ thirdColon ifNil: [
                thirdColon := (PRPage named: 'thirdColon')
                title: 'Gratta & torna';
                contents:
        ' Gratta & torna
       
        valuta utilizzata €';
       
        yourself
        ]
       

Thanks,

                Dario
Reply | Threaded
Open this post in threaded view
|

Re: Some errors

Dale Henrichs
Dario Trussardi wrote:

> Hi,
>
>
>> Dario Trussardi wrote:
>>> Hi,
>>> i work with GLASS 1.0-beta.9
>>> I found two problem:
>>> A) Into GLASS when i have a string with the character €
>>> ' dario € ' asString the system erase the error :
>>> _compileInContext: anObject symbolList: aSymbolList "Returns a GsMethod that is not in the method dictionary of any class, or else generates an error if there are compilation errors." <primitive: 150> aSymbolList _validateClass: SymbolList . ^ self _primitiveFailed: #_compileInContext:symbolList:
>>> *
>>> *
>>> *B) the '.' split: 'www.dariospizza.com' into GLASS d'ont work. *
>>> *
>>> *
>>> * it return a array with one empty string.*
>>> *
>>> *
>>> *
>>> *
>>> * in Pharo it return a array with 3 elements.*
>>> Thank,
>>> Dario
>> Dario,
>>
>> Regarding ' dario € '. In 2.4.4.1, the source for compilation must be either a String or DoubleByteString .... To work with multibyte characters, I tend to work with ByteArrays that contain the UTF8 encoding for the string, and send #decodeFromUTF8 to create my multibyte strings.
>>
>
> Anyone have example about it ?
>
> I'm interested to manage PRPage where contents:
>
> include  'string' with the € .
>
> For example
>
> thirdColon
> ^ thirdColon ifNil: [
> thirdColon := (PRPage named: 'thirdColon')
> title: 'Gratta & torna';
> contents:
> ' Gratta & torna
>
> valuta utilizzata €';
>
> yourself
> ]
>
>
> Thanks,
>
> Dario

Given that I believe that the asciiValue of the € is 8364, You can
fabricate an Array of integers that can be embedded in your code.

Here's the code to convert the € to a UTF8 encoded string:

   (String with: (Character value: 8364)) encodeAsUTF8 asByteArray.

Which results in a ByteArray (226 130 172), so the following code can be
compiled into a method and will produce the QuadByteString containing €:

   #( 226 130 172) asByteArray asString decodeFromUTF8

The it follows that the following expression should return true:

   (String with: (Character value: 8364)) =
     #( 226 130 172) asByteArray asString decodeFromUTF8

A little convoluted, but it gets you where you want to be:)

Dale
Reply | Threaded
Open this post in threaded view
|

Re: Some errors

dario trussardi
Dale,

>>>
>>> nd send #decodeFromUTF8 to create my multibyte strings.
>>>
>> Anyone have example about it ?
>> I'm interested to manage PRPage where contents: include  'string' with the € .
>> For example
>> thirdColon
>> ^ thirdColon ifNil: [
>> thirdColon := (PRPage named: 'thirdColon')
>> title: 'Gratta & torna';
>> contents:
>> ' Gratta & torna
>>
>> valuta utilizzata €';
>>
>> yourself
>> ]
>>
>> Thanks,
>> Dario
>
> Given that I believe that the asciiValue of the € is 8364, You can fabricate an Array of integers that can be embedded in your code.
>
> Here's the code to convert the € to a UTF8 encoded string:
>
>  (String with: (Character value: 8364)) encodeAsUTF8 asByteArray.
>
> Which results in a ByteArray (226 130 172), so the following code can be compiled into a method and will produce the QuadByteString containing €:
>
>  #( 226 130 172) asByteArray asString decodeFromUTF8
>
> The it follows that the following expression should return true:
>
>  (String with: (Character value: 8364)) =
>    #( 226 130 172) asByteArray asString decodeFromUTF8
>
> A little convoluted, but it gets you where you want to be:)

Ok.

I add to the class String the method :

        euroString

        " DTR gestione creazione character Euro in stringa "
       
        ^ #( 226 130 172) asByteArray asString decodeFromUTF8

Now when create a string for add the € symbol i call : String euroString
 
>> ' Gratta & torna
>>
>> valuta utilizzata ' , String euroString' ,  '...................'

Other best solution ?

Thank,

        Dario

Reply | Threaded
Open this post in threaded view
|

Re: Some errors

Yan Laporte-2
In reply to this post by Dale Henrichs
How i sent around the split: problem is that I do 'www.dariopizza.com' splitOn: '.' instead. I implemented splitOn: on gemstone as

splitOn:aString
^self split:aString.

yl

Envoyé de mon iPhone

Le 2010-09-07 à 12:45, Dale Henrichs <[hidden email]> a écrit :

> Dario Trussardi wrote:
>> Hi,
>> i work with GLASS 1.0-beta.9
>> I found two problem:
>> A) Into GLASS when i have a string with the character €
>> ' dario € ' asString the system erase the error :
>> _compileInContext: anObject symbolList: aSymbolList "Returns a GsMethod that is not in the method dictionary of any class, or else generates an error if there are compilation errors." <primitive: 150> aSymbolList _validateClass: SymbolList . ^ self _primitiveFailed: #_compileInContext:symbolList:
>> *
>> *
>> *B) the '.' split: 'www.dariospizza.com' into GLASS d'ont work. *
>> *
>> *
>> * it return a array with one empty string.*
>> *
>> *
>> *
>> *
>> * in Pharo it return a array with 3 elements.*
>> Thank,
>> Dario
>
> Dario,
>
> Regarding ' dario € '. In 2.4.4.1, the source for compilation must be either a String or DoubleByteString .... To work with multibyte characters, I tend to work with ByteArrays that contain the UTF8 encoding for the string, and send #decodeFromUTF8 to create my multibyte strings.
>
>
> The split issue is covered by Issue 52 (http://code.google.com/p/glassdb/issues/detail?id=52) not fixed ... I haven't gotten around to resolving the #split: issue, but apparently it is/was used in other parts of GLASS ...
>
>