Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0007817 [Squeak] VM minor always 04-13-14 14:38 12-10-14 15:59
Reporter lewis View Status public  
Assigned To lewis
Priority normal Resolution open  
Status assigned   Product Version
Summary 0007817: Fix vm-display-X11 problem for Japanese character input
Description Fix provided by Hachisuka-San in Aichi Sangyo University

Reported by TAKAHASHI Makoto (makoto at kobe-u.ac.jp)

Posted by Hilaire Fernandes on Pharo list
http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/2014-April/094588.html [^]

Proposed fix for vm-display-X11/sqUnixX11.c is included in post from Hilaire.
Additional Information Fix excerpted from mailing list post:
De : "TAKAHASHI Makoto" <makoto at kobe-u.ac.jp>
Date : 11 avr. 2014 15:46
Objet : Re: Japanese input in DrGeo
: <hilaire.fernandes at gmail.com>
Cc :

Hello Hilarie,

Recently, Hachisuka-San in Aichi Sangyo University has resolved the issue
of Scratch in Linux.
http://www.asu.ac.jp/hachi/v3/scratch14ime.html [^]

Unfortunately, this page is written in Japanese. (However you can see
codes.)
The resolution of the problem in DrGeo is as follows:
1. In drgeo.sh, add exec options '-compositioninput' like
exec "$VM/pharo" \
        -plugins "$VM" \
        -encoding utf-8 \
        -vm-display-X11 \
        -compositioninput \
        "$image"

2. Change recordPendingKeys(void) in vm-display-X11/sqUnixX11.c as follows
and
rebuild vm-display-X11.

static int recordPendingKeys(void)
{
  if (inputCount <= 0) {
    if (inputBuf != inputString) {
      free(inputBuf);
      inputBuf= inputString;
    }
    return 0;
  }

  int utf32 = 0;
  while (inputCount > 0) {
        //110x xxxx 10xx xxxx
        if(inputCount >= 2 &&
           pendingKey[0] >= 0xc0 && pendingKey[0] <= 0xdf &&
           pendingKey[1] >= 0x80 && pendingKey[1] <= 0xbf)
                {
                utf32 = ((pendingKey[0] & 0x1f) << 6) |
                         (pendingKey[1] & 0x3f);
                recordKeyboardEvent(0, EventKeyDown, modifierState, utf32);
                recordKeyboardEvent(0, EventKeyChar, modifierState, utf32);
                pendingKey+=2;
                inputCount-=2;
        //1110 xxxx 10xx xxxx 10xx xxxx
        } else if(inputCount >= 3 &&
                  pendingKey[0] >= 0xe0 && pendingKey[0] <= 0xef &&
                  pendingKey[1] >= 0x80 && pendingKey[1] <= 0xbf &&
                  pendingKey[2] >= 0x80 && pendingKey[2] <= 0xbf)
                {
                utf32 = ((pendingKey[0] & 0x0f) << 12) |
                        ((pendingKey[1] & 0x3f) << 6) |
                         (pendingKey[2] & 0x3f);
                recordKeyboardEvent(0, EventKeyDown, modifierState, utf32);
                recordKeyboardEvent(0, EventKeyChar, modifierState, utf32);
                pendingKey+=3;
                inputCount-=3;
        //1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx
        } else if(inputCount >= 4 &&
                  pendingKey[0] >= 0xf0 && pendingKey[0] <= 0xf7 &&
                  pendingKey[1] >= 0x80 && pendingKey[1] <= 0xbf &&
                  pendingKey[2] >= 0x80 && pendingKey[2] <= 0xbf &&
                  pendingKey[3] >= 0x80 && pendingKey[3] <= 0xbf)
                {
                utf32 = ((pendingKey[0] & 0x07) << 18) |
                        ((pendingKey[1] & 0x3f) << 12) |
                        ((pendingKey[2] & 0x3f) << 6) |
                         (pendingKey[3] & 0x3f);
                recordKeyboardEvent(0, EventKeyDown, modifierState, utf32);
                recordKeyboardEvent(0, EventKeyChar, modifierState, utf32);
                pendingKey+=4;
                inputCount-=4;
        } else {
                recordKeyboardEvent(*pendingKey, EventKeyDown,
modifierState, 0);
                recordKeyboardEvent(*pendingKey, EventKeyChar,
modifierState, 0);
                recordKeystroke(*pendingKey); /* DEPRECATED */
                pendingKey++;
                inputCount--;
        }
  }
  return 1;
}

3. Exchange vm-display-X11 in DrGeo.app/Contents/Linux.

I tried this resolution. Finally I can put japanese character in DrGeo in
LinuxMint 16.




TAKAHASHI Makoto E-mail makoto at kobe-u.ac.jp
Attached Files  drgeojapaneseinput.png [^] (93,330 bytes) 04-13-14 14:40
 sqUnixX11.c [^] (183,451 bytes) 04-13-14 14:50

- Relationships

- Notes
(0014495 - 144 - 168 - 312 - 312 - 312 - 312)
lewis
04-13-14 14:47
edited on: 04-13-14 14:51

Original problem description and fix are at http://www.asu.ac.jp/hachi/v3/scratch14ime.html [^]

The attached sqUnixX11.c is from that web page.

 
(0014521 - 148 - 166 - 384 - 384 - 384 - 384)
lewis
12-10-14 15:59

Hillaire posted a follow up inquiry from
TAKAHASHI Makoto:

http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/2014-December/103882.html [^]
 

- Issue History
Date Modified Username Field Change
04-13-14 14:38 lewis New Issue
04-13-14 14:38 lewis Status new => assigned
04-13-14 14:38 lewis Assigned To  => lewis
04-13-14 14:40 lewis File Added: drgeojapaneseinput.png
04-13-14 14:47 lewis Note Added: 0014495
04-13-14 14:50 lewis File Added: sqUnixX11.c
04-13-14 14:51 lewis Note Edited: 0014495
12-10-14 15:59 lewis Note Added: 0014521


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
44 total queries executed.
30 unique queries executed.
Powered by Mantis Bugtracker