Announcement

Collapse
No announcement yet.

How to type unicode characters in Kate?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to type unicode characters in Kate?

    Using the ctrl+shift+u route does nothing.

    Setting a "compose" key does nothing.

    On the same machine and OS, both methods work in gtk3 applications such as the text box in Firefox or Chrome, in LibreOffice, and in text editors such as Mousepad and Leafpad.

    I can copy/paste the desired code from another document into Kate but would like to do this directly if possible.
    Kubuntu 20.04

    #2
    Originally posted by chimak111 View Post
    Setting a "compose" key does nothing.
    Hmm, Compose key works fine in kate on my end, <Compose>(release),<a>,<e> produces "æ" as expected.

    Comment


      #3
      Originally posted by kubicle View Post
      Hmm, Compose key works fine in kate on my end, <Compose>(release),<a>,<e> produces "æ" as expected.
      You're right! I can get æ, œ, ©, ¶ and probably many others, but not others like

      <Multi_key> <equal> <underscore> ≡
      <Multi_key> <o> <r> ®
      <Multi_key> <T> <M> ™
      Kubuntu 20.04

      Comment


        #4
        Originally posted by chimak111 View Post
        <Multi_key> <equal> <underscore> ≡
        <Multi_key> <o> <r> ®
        <Multi_key> <T> <M> ™
        These also work fine here. For troubleshooting purposes, do the combinations work if you place them in ~/.XCompose like this:
        Code:
        <Multi_key> <equal> <underscore>    : "≡"
        <Multi_key> <o> <r>                 : "®"
        <Multi_key> <T> <M>                 : "™"

        Comment


          #5
          Originally posted by kubicle View Post
          These also work fine here. For troubleshooting purposes, do the combinations work if you place them in ~/.XCompose like this:
          Code:
          <Multi_key> <equal> <underscore>    : "≡"
          <Multi_key> <o> <r>                 : "®"
          <Multi_key> <T> <M>                 : "™"
          I did that and rebooted. (I guess there's some way to source .XCompose.) Now ≡ and ® work in Kate but the last one doesn't: I get just "m" instead of ™.
          Kubuntu 20.04

          Comment


            #6
            Originally posted by chimak111 View Post
            I did that and rebooted. (I guess there's some way to source .XCompose.)
            This should be unnecessary, the changes should work right away.

            Originally posted by chimak111 View Post
            Now ≡ and ® work in Kate but the last one doesn't: I get just "m" instead of ™.
            Are you typing Capital T and M, and not t and m? (I'm asking because you getting an "m" suggests the latter. If you wish to use just t and m for ™, change "<T> <M>" to "<t> <m>" in .XCompose.

            Of course, common compose recipes should work without per user configuration in .XCompose, so there is something wrong...possibly an input method problem in qt configuration (especially if compose recipes work fine in gtk apps).

            Comment


              #7
              Originally posted by kubicle View Post
              This should be unnecessary, the changes should work right away.
              Thanks!
              Are you typing Capital T and M, and not t and m? (I'm asking because you getting an "m" suggests the latter. If you wish to use just t and m for ™, change "<T> <M>" to "<t> <m>" in .XCompose.
              I used caps in .XCompose and lower case when actually trying. Using upper case fixed that in Kate.

              Of course, common compose recipes should work without per user configuration in .XCompose, so there is something wrong...possibly an input method problem in qt configuration (especially if compose recipes work fine in gtk apps).
              Yes, using lower case t and m with compose works in gtk apps. And gtk apps seem more forgiving.
              Kubuntu 20.04

              Comment


                #8
                Originally posted by chimak111 View Post
                Yes, using lower case t and m with compose works in gtk apps. And gtk apps seem more forgiving.
                The default composing rules includes several different methods to produce trade mark (so capitalization shouldn't matter):
                <dead_circumflex> <Multi_key> <T> <M> : "™" U2122 # TRADE MARK SIGN
                <Multi_key> <T> <M> : "™" U2122 # TRADE MARK SIGN
                <dead_circumflex> <Multi_key> <t> <M> : "™" U2122 # TRADE MARK SIGN
                <Multi_key> <t> <M> : "™" U2122 # TRADE MARK SIGN
                <dead_circumflex> <Multi_key> <T> <m> : "™" U2122 # TRADE MARK SIGN
                <Multi_key> <T> <m> : "™" U2122 # TRADE MARK SIGN
                <dead_circumflex> <Multi_key> <t> <m> : "™" U2122 # TRADE MARK SIGN
                <Multi_key> <t> <m> : "™" U2122 # TRADE MARK SIGN
                This should explain why they work in gtk, but obviously not why the default rules are not there for you in kate (while they work fine here).

                If you wish to troubleshoot further, the next things to check would be the default Compose file for your locale (/usr/share/X11/locale/<your_locale>/Compose), and possible input method variables ("env | grep IM_MODULE")

                Comment


                  #9
                  Originally posted by kubicle View Post
                  If you wish to troubleshoot further, the next things to check would be the default Compose file for your locale (/usr/share/X11/locale/<your_locale>/Compose), and possible input method variables ("env | grep IM_MODULE")
                  env | grep IM_MODULE comes up empty.

                  $ env | grep -i lang
                  LANG=en_IN
                  LANGUAGE=
                  $

                  And I've been looking at /usr/share/X11/locale/en_US.UTF-8/Compose.
                  Kubuntu 20.04

                  Comment


                    #10
                    Originally posted by chimak111 View Post
                    And I've been looking at /usr/share/X11/locale/en_US.UTF-8/Compose.
                    And you are using a utf-8 locale? (what does the command "locale" output?)

                    Comment


                      #11
                      Originally posted by kubicle View Post
                      And you are using a utf-8 locale? (what does the command "locale" output?)
                      Here it is:
                      Code:
                      $ locale
                      LANG=en_IN
                      LANGUAGE=
                      LC_CTYPE="en_IN"
                      LC_NUMERIC="en_IN"
                      LC_TIME="en_IN"
                      LC_COLLATE="en_IN"
                      LC_MONETARY="en_IN"
                      LC_MESSAGES="en_IN"
                      LC_PAPER="en_IN"
                      LC_NAME="en_IN"
                      LC_ADDRESS="en_IN"
                      LC_TELEPHONE="en_IN"
                      LC_MEASUREMENT="en_IN"
                      LC_IDENTIFICATION="en_IN"
                      LC_ALL=
                      $
                      Kubuntu 20.04

                      Comment


                        #12
                        I'm not familiar with the english(India) locale, but there seem to exist both en_IN and en_IN.UTF-8 locales in the default install (checked with "locale -a"), so there is a chance that the former doesn't actually read the system compose recipes in /usr/share/X11/locale/en_US.UTF-8/Compose.

                        The en_IN.utf8 locale points to /usr/share/X11/locale/en_US.UTF-8/Compose (in /usr/share/X11/locale/compose.dir), so the utf8 locale should read the correct file.

                        You could try switching to the utf-8 locale or alternatively you could put:
                        Code:
                        include "/usr/share/X11/locale/en_US.UTF-8/Compose"
                        in the beginning of your ~/.XCompose file which should make it read the default recipes (you can then create your own recipes below that if you wish)
                        Last edited by kubicle; Oct 29, 2018, 01:12 AM.

                        Comment


                          #13
                          Originally posted by kubicle View Post
                          or alternatively you could put:
                          Code:
                          include "/usr/share/X11/locale/en_US.UTF-8/Compose"
                          in the beginning of your ~/.XCompose file which should make it read the default recipes (you can then create your own recipes below that if you wish)
                          This vastly improves things! I've kept just the include line for now.
                          Kubuntu 20.04

                          Comment


                            #14
                            @kubicle, in this Ask Ubuntu question, the user, probably Chinese, wants to type a Unicode, such as 0x1234 to display 'ሴ' Is that possible using the compose key? There are large parts of /usr/share/X11/locale/en_US.UTF-8/Compose which I don't understand but which may provide a solution to this users's question:

                            <dead_abovedot> <Multi_key> <f> <s> : "ẛ" U1e9b # LATIN SMALL LETTER LONG S WITH DOT ABOVE

                            <Multi_key> <dead_abovedot> <f> <s> : "ẛ" U1e9b # LATIN SMALL LETTER LONG S WITH DOT ABOVE

                            <Multi_key> <numbersign> <S> : "♬" U266c # BEAMED SIXTEENTH NOTES

                            and so many more.
                            Kubuntu 20.04

                            Comment


                              #15
                              i'm just reading through this thread...

                              i looked, and i do not have an .XCompose file, at all...

                              does that mean that, if i create an .XCompose file that contains the include line mentioned above, it will enable the compose key on my machine?
                              ⇑ Hybrid Elephant
                              http://www.hybridelephant.com/
                              ⇓ The world's finest exotic incense

                              Comment

                              Working...
                              X