[PD-dev] [ pure-data-Patches-3160982 ] [bugfix] allow to type UTF8 characters in symbolatoms
SourceForge.net
noreply at sourceforge.net
Wed Jan 19 11:09:05 CET 2011
Patches item #3160982, was opened at 2011-01-18 18:16
Message generated for change (Comment added) made by zmoelnig
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=478072&aid=3160982&group_id=55736
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
>Category: puredata
>Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: IOhannes m zmlnig (zmoelnig)
Assigned to: Miller Puckette (millerpuckette)
>Summary: [bugfix] allow to type UTF8 characters in symbolatoms
Initial Comment:
since Pd-0.43 patches can handle UTF-8 characters. great!
unfortunately, it doesn't seem to work when typing in symbolboxes.
example:
i switch to a russian(DOS) keyboard layout
i create a message box and type the keys 'asd' which correctly shows up as 'ыфв'
i create a symbolgatom and type the keys 'asd' which incorrectly show up as 'DK2'
note: sending a [symbol ыфв( to the symbolgatom, will correctly display it.
it seems like the keyboard input sanitation code for the symbolbox perverts my input.
----------------------------------------------------------------------
>Comment By: IOhannes m zmlnig (zmoelnig)
Date: 2011-01-19 11:09
Message:
anyhow, i have a fix for the problem.
instead of writing the wchar into a char, the wchar is first decoded to
utf8 using u8_wc_toutf8() and only then written into the symbol-buffer of
the atom.
this seems to work fine.
the attached patch modifies g_text.c and applies to f5cabb ("took out
debug msg")
----------------------------------------------------------------------
Comment By: Bryan Jurish (mukau)
Date: 2011-01-19 11:08
Message:
ok; trying to look into this now; have you any idea what sources you built
from? I'm currently using most recent snapshot from
http://pure-data.git.sourceforge.net/git/gitweb.cgi?p=pure-data/pd-extended.git;a=summary
; ... svn doesn't appear to have the utf-8 patches applied anywhere yet...
----------------------------------------------------------------------
Comment By: IOhannes m zmlnig (zmoelnig)
Date: 2011-01-19 11:01
Message:
@mukau: no, LC_* are not changed at all (btw, they are set to de_AT.UTF-8
here)
the kbd layout changes only effect the key->character mapping, way before
tk is involved.
also note, that tk can handle all quite well, as can most parts of Pd
(confirm: i can type cyrillic characters in objects, msgboxes and
comments)
it's only gatom's that do some additional magic to filter out unwanted
characters, and then write the received wchar into a char without checking.
----------------------------------------------------------------------
Comment By: Bryan Jurish (mukau)
Date: 2011-01-18 21:45
Message:
What exactly does "changing the keyboard layout" entail? Does it e.g.
change your locale (LC_ALL, LC_CTYPE, etc.)? That might annoy Tk's unicode
handling...
----------------------------------------------------------------------
Comment By: IOhannes m zmlnig (zmoelnig)
Date: 2011-01-18 18:31
Message:
one more thing:
in the original report i said that typing 'asd' should result in 'ыфв'
which is wrong.
it should rseult in ''фыв'
('a'='ф', 's'='ы', 'd'='в')
----------------------------------------------------------------------
Comment By: IOhannes m zmlnig (zmoelnig)
Date: 2011-01-18 18:30
Message:
btw, in normal (de) kbd-layout, when i type (and releae) 'a', pd-gui
sends:
.x99e9708 key 1 97 0;
.x99e9708 key 0 97 0;
whereas when i switch to russian, pd-gui sends (again key 'a'):
.x99e9708 key 1 1092 0;
.x99e9708 key 0 a 0;
"1092" is the unicode number for "ф" (which is what should show up, when
i press 'a')
i don't know why the keyup sends 'a' instead.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=478072&aid=3160982&group_id=55736
More information about the Pd-dev
mailing list