Re: looking for Unicode testers

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

Re: looking for Unicode testers

Michael Rueger-6
John M McIntosh wrote:

>> Where is this set?
>
> http://smalltalkconsulting.com/html/squeakinfoplist.html
>
> SqueakEncodingType

Ah, thanks!

>> If you put a transcript show of the event buffer into the
>> handleKeyboard logic you can see that slot six is nil on meta keys.
>
> meta-keys not sure what you are refering to? How about an example?

alt/ctrl
so if you hit alt-c (apple-c) slot six is nil

>> Oh, I thought the new Mac VMs supported Unicode in the clipboard logic
>> as the other VMs now do.
>> How much effort would that be to add UTF-x support to the current
>> clipboard logic?
>
> Well that *is* the extended clipboard support. Just need the smalltalk
> code to make the proper primitive calls to the extended clipboard plugin.
> You need the ClipboardExtendedPlugin.bundle

OK, will do for now.
Guess in future versions we should remove the clipboard support from the
core VM and replace it by the (extended) clipboard plugin.

Michael


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: looking for Unicode testers

Michael Rueger-6
Michael Rueger wrote:

>> Well that *is* the extended clipboard support. Just need the smalltalk
>> code to make the proper primitive calls to the extended clipboard plugin.
>> You need the ClipboardExtendedPlugin.bundle

Hmm, you still need FFI despite the plugin:

readUTF8StringClipboardData
        | bytes |
        "utf8"

        bytes := self readClipboardData: 'public.utf8-plain-text'.
        bytes := MacCFString callMakeUTF8NormalizedStringViaByteString: bytes
asString.
        ^bytes ifNil: [bytes] ifNotNil:
                [bytes asString convertFromWithConverter: (UTF8TextConverter new)]



Michael

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: looking for Unicode testers

johnmci
In reply to this post by Michael Rueger-6

On 11-Feb-09, at 6:39 AM, Michael Rueger wrote:
>

> alt/ctrl
> so if you hit alt-c (apple-c) slot six is nil

Well you have 3 different events that occur on tapping that key(s)
This follows the rules set by the windows VM.

on the down stroke, we give you EventTypeKeyboard->EventKeyDown, the  
macintosh keycode (some virtual magic number), and zero for the  
unicode value

After the operating system determines what that plastic or rubber key  
was,
we send EventTypeKeyboard-> EventKeyChar, the macintosh macRoman  
character (if possible, may be zero), and the unicode value

Once the key is released,
we send EventTypeKeyboard> EventKeyUp , the macintosh keycode (some  
virtual magic number), and zero for the unicode value

If the key is held down it repeats, and according to windows rules it  
doesn't send the keyup (I believe check the archives), just key down,  
key char

I had offered to return the unicode value for keydown/keyup but was  
told it was too hard for the windows VM to provide that data at the  
point where
key down/up occurs

http://lists.squeakfoundation.org/pipermail/squeak-dev/2003-December/071701.html

As you know some flavours of the Squeak UI look for character input on  
keyChar or keyUp...


So is this on key up/down or key char?


>
>
>>> Oh, I thought the new Mac VMs supported Unicode in the clipboard  
>>> logic as the other VMs now do.
>>> How much effort would that be to add UTF-x support to the current  
>>> clipboard logic?
>> Well that *is* the extended clipboard support. Just need the  
>> smalltalk code to make the proper primitive calls to the extended  
>> clipboard plugin.
>> You need the ClipboardExtendedPlugin.bundle
>
> OK, will do for now.
> Guess in future versions we should remove the clipboard support from  
> the core VM and replace it by the (extended) clipboard plugin.
>
> Michael
>

--
=
=
=
========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
=
=
=
========================================================================




_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: looking for Unicode testers

johnmci
In reply to this post by Michael Rueger-6
No, it's just more smalltalk coding, the utf8-plain-text bytes need to  
be translated into bytes according to

"Normalizes the string into the specified form as described in Unicode  
Technical Report #15."
and ensure we return the bytes as UTF8.

The FFI calls let the macintosh operating system deal with the messy  
details.


http://unicode.org/unicode/standard/reports/tr15/tr15-18.html
also see
http://developer.apple.com/qa/qa2001/qa1235.html

Say is that a precomposed and decomposed Unicode you have there,  
really what does squeak want? want does the operating system want.
Choices choices.

PS beware the utf8 to macroman or macroman to utf8 text converts in  
squeak, I don't think the one that came from etoys does the right thing
can't remember, it's named wrong, does utf8 to ascii or something...


On 11-Feb-09, at 7:29 AM, Michael Rueger wrote:

> Michael Rueger wrote:
>
>>> Well that *is* the extended clipboard support. Just need the  
>>> smalltalk code to make the proper primitive calls to the extended  
>>> clipboard plugin.
>>> You need the ClipboardExtendedPlugin.bundle
>
> Hmm, you still need FFI despite the plugin:
>
> readUTF8StringClipboardData
> | bytes |
> "utf8"
>
> bytes := self readClipboardData: 'public.utf8-plain-text'.
> bytes := MacCFString callMakeUTF8NormalizedStringViaByteString:  
> bytes asString.
> ^bytes ifNil: [bytes] ifNotNil:
> [bytes asString convertFromWithConverter: (UTF8TextConverter new)]
>
>
>
> Michael

--
=
=
=
========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
=
=
=
========================================================================




_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: looking for Unicode testers

Michael Rueger-6
John M McIntosh wrote:
> No, it's just more smalltalk coding, the utf8-plain-text bytes need to
> be translated into bytes according to

Somewhere in the call chain it is finally FFI calls as you illustrate below.

How much would it take to have the primitive return the normalized UTF-8
string directly?

Michael

>
> "Normalizes the string into the specified form as described in Unicode
> Technical Report #15."
> and ensure we return the bytes as UTF8.
>
> The FFI calls let the macintosh operating system deal with the messy
> details.
>
>
> http://unicode.org/unicode/standard/reports/tr15/tr15-18.html
> also see
> http://developer.apple.com/qa/qa2001/qa1235.html
>
> Say is that a precomposed and decomposed Unicode you have there, really
> what does squeak want? want does the operating system want.
> Choices choices.
>
> PS beware the utf8 to macroman or macroman to utf8 text converts in
> squeak, I don't think the one that came from etoys does the right thing
> can't remember, it's named wrong, does utf8 to ascii or something...
>
>
> On 11-Feb-09, at 7:29 AM, Michael Rueger wrote:
>
>> Michael Rueger wrote:
>>
>>>> Well that *is* the extended clipboard support. Just need the
>>>> smalltalk code to make the proper primitive calls to the extended
>>>> clipboard plugin.
>>>> You need the ClipboardExtendedPlugin.bundle
>>
>> Hmm, you still need FFI despite the plugin:
>>
>> readUTF8StringClipboardData
>>     | bytes |
>>     "utf8"
>>
>>     bytes := self readClipboardData: 'public.utf8-plain-text'.
>>     bytes := MacCFString callMakeUTF8NormalizedStringViaByteString:
>> bytes asString.
>>     ^bytes ifNil: [bytes] ifNotNil:
>>         [bytes asString convertFromWithConverter: (UTF8TextConverter
>> new)]
>>
>>
>>
>> Michael
>
> --
> ===========================================================================
> John M. McIntosh <[hidden email]>
> Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
> ===========================================================================
>
>
>
>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: looking for Unicode testers

johnmci

On 12-Feb-09, at 5:12 AM, Michael Rueger wrote:

> John M McIntosh wrote:
>> No, it's just more smalltalk coding, the utf8-plain-text bytes need  
>> to be translated into bytes according to
>
> Somewhere in the call chain it is finally FFI calls as you  
> illustrate below.
>
> How much would it take to have the primitive return the normalized  
> UTF-8 string directly?
>
> Michael

Er, case of beer?

Seriously tho you need to define if the UTF8 you expect squeak to work  
with is  precomposed and decomposed Unicode.
Then we can alter the plugin, also having a test case would be  
helpful,  move data into squeak, move data out of squeak.
Well and enabling the ability to copy/paste PNG or JPEG would be  
helpful, again the plugin can help with this, but you'll
need a frame work (ala sophie) to front the existing logic, that and  
the windows VM support.

--
=
=
=
========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
=
=
=
========================================================================




_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: looking for Unicode testers

Michael Rueger-6
On Thu, Feb 12, 2009 at 7:19 PM, John M McIntosh
<[hidden email]> wrote:

>> How much would it take to have the primitive return the normalized UTF-8
>> string directly?


> Er, case of beer?

What kind? :-)
Duckstein?

> Seriously tho you need to define if the UTF8 you expect squeak to work with
> is  precomposed and decomposed Unicode.

I would say precomposed, basically what is returned by the extended
clipboard logic.

> need a frame work (ala sophie) to front the existing logic, that and the
> windows VM support.

Windows already returns UTF-8 in the default Squeak clipboard, as does Linux.

michael

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project