[Seaside] Re: TableReport slow down

Bob Arning arning315 at comcast.net
Fri Jan 1 17:16:00 UTC 2016


Sounds like an encoding issue. Your code inserted into my app produced a 
euro sign where I had been printing a fancy leftarrow. This is a much 
older seaside and has a GRNullCodec as the codec of the requestContext. 
If you are using a different codec, then it may be thinking your utf8 
euro sign is really 3 oddball characters and rendering them separately. 
Perhaps you can do something with the codec (like use a null?).

On 1/1/16 11:19 AM, Hilaire wrote:
>
> Thanks for the tips.
>
> I naively try this:
>
> printOn:
>     aStream << (amount asScaledDecimal: 2) greaseString
>     << ' ' << (ByteArray with: 16rE2 with: 16r82 with: 16rAC) asString
>
>
> But somehow I must be missing something because it does not work as 
> expected.
> I got garbage currency :) 514.25 €
>
> Hilaire
>
>
> Le 01/01/2016 12:54, Bob Arning a écrit :
>> What worked for me once upon a time was to convert the euro character 
>> to a series of utf-8 bytes.
>>
>> http://www.fileformat.info/info/unicode/char/20aC/index.htm
>>
>> so, for euro-currency signU+20A0 
>> <http://www.fileformat.info/info/unicode/char/20a0/index.htm> you 
>> would need a 3-byte string whose characters in hex were: 0xE2 0x82 0xAC
>>
>> In squeak, I used this
>>
>> utf8ForCodePoint: cp
>>
>> "===
>> SEUtils utf8ForCodePoint: 16r2190
>>
>> 16r2190 radix: 2 '10000110010000'
>>
>> 16    U+FFFF    1110xxxx    10xxxxxx    10xxxxxx
>> ==="
>>
>>     | bits answer |
>>
>>     bits := (cp radix: 2) padded: #left to: 16 with: $0.
>>     answer := String new.
>>     {
>>         '2r1110',(bits copyFrom: 1 to: 4).
>>         '2r10',(bits copyFrom: 5 to: 10).
>>         '2r10',(bits copyFrom: 11 to: 16).
>>     } do: [ :radix2 |
>>         answer := answer, (String with: (Character value: radix2 
>> asNumber)).
>>     ].
>>
>>     ^answer
>>
>> On 1/1/16 5:09 AM, Hilaire wrote:
>>> Le 31/12/2015 15:42, Sven Van Caekenberghe a écrit :
>>>> A possible solution is to somehow start with a WideString from the beginning (or force it before doing all elements one by one).
>>> In the hack you are suggesting, does it not required the whole contents
>>> of the rendered page html code to be put as WideString?
>>> Indeed, hacking only my object #printOn: method to send WideString to
>>> the stream does not help.
>>>
>>> Hilaire
>>>
>>
>>
>>
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
> -- 
> Dr. Geo
> http://drgeo.eu
> http://google.com/+DrgeoEu
>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20160101/4fecf77f/attachment.htm


More information about the seaside mailing list