Announcement

Collapse
No announcement yet.

genieWriteStr and special characters

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • genieWriteStr and special characters

    Hi everyone,

    I have a 70DT display, forms designed with ViSi-Genie and a raspberry pi to control it.
    But I can't figure out how to send special characters like Ö or é to a text field.
    Any suggestions or example code?

    Kind regards,
    Der Freiburger

  • #2
    You will need to use genieWriteStrU, and write unicode strings. This will also require the unicode option to be set in the Strings object.

    It appears that genieWriteStrU is not defined in the header file, but does actually exist.

    You can try it after adding it to the header file if you like.

    We will get it properly tested and 'fixed'.
    Mark

    Comment


    • #3
      Do you have an example for me?
      I tried it with "Bj\xf6rn" and "Bj\u00f6rn" without luck.

      Comment


      • #4
        Hi,

        First of all, special characters for languages must be supported by the RPi. Please make sure that the locale and keyboard set is properly configured.

        Send Unicode characters such as ,Ö, as a part of string will require this command - genieWriteStrU(0, "Ö");
        The genieWriteStrU(0, "Ö") function accepts the unicode characters directly.

        ** This uses the library posted on 4D Systems website.


        #include <stdio.h>
        #include <stdlib.h>
        #include <errno.h>
        #include <pthread.h>
        #include <geniePi.h>

        int main()
        {
        if (genieOpen(4, 9600) < 0 )
        {
        fprintf (stderr, "Can't initialise Genie Display: %s\n", strerror (errno)) ;
        return 1 ;
        }
        delay(1000);
        printf("Starting to send string and unicode\n\n");
        genieWriteStr(0, "HELLO WORLD");
        genieWriteStrU(0, "Ö");
        delay(500);
        genieClose();
        return 0 ;
        }

        ** Please note that it is assumed that you have a perfectly working serial/uart connection for the Rpi and 4D Systems intelligent module.

        I have also attached a simple ViSi-Genie based project for your testing.

        Regards,
        Bryan
        Attached Files

        Comment


        • #5
          Hi Bryan,

          genieOpen is not declared in the header file, so I used genieSetup.
          But as soon as I call genieWriteStrU my program freezes and the text field doesn't update.

          Any suggestions?


          Regards,
          Daniel

          Comment


          • #6
            Hi Daniel,

            Sorry for the late reply .

            Can't seem to think of any other reasons other than problems with data being sent by the Raspberry Pi. If you try to use the GTX tool from Workshop IDE and send the special characters(use character map from Windows) you will see that it sends the character with no problems.

            If you could maybe check and report back the output of the command genieWriteStrU on a serial monitor then that would help us find the reason behind.

            Regards,
            Bryan

            Comment


            • #7
              Hi Bryan,

              because genieWriteStrU is not working for me I solved it with the normal genieWriteStr and converted the UTF-8 string to ANSI by myself
              with the help of this table: http://www.utf8-zeichentabelle.de/un...codeinhtml=dec
              Outputting the transfered characters in _genieWriteStr was very helpful for that.


              Regards,
              Daniel

              Comment

              Working...
              X