Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Development
  3. message.c in libnetxms is right for east asian characters

message.c in libnetxms is right for east asian characters

Scheduled Pinned Locked Moved Development
19 Posts 2 Posters 110.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    S
    szll2010
    wrote on last edited by
    #5

    Hi Victor,

    Thanks for your quick action.

    Is there any chance to port Agent to Unicode?

    1 Reply Last reply
    0
    • V
      V
      Victor Kirhenshtein
      wrote on last edited by
      #6

      Hi!

      Theoretically it is possible, but it will require a lot of work, because many places in agent code was written with usage of char instead of TCHAR, and because many system APIs on UNIX systems exist only in multi byte or event single byte form. I think that it can be relatively easy to convert Windows agent to unicode, and much harder to convert UNIX agent to unicode. Why you need unicode in agent?

      Best regards,
      Victor

      1 Reply Last reply
      0
      • S
        S
        szll2010
        wrote on last edited by
        #7

        Hi Victor,

        I try to manage some WIN CE devices. Not sure that MBCS is no problem. Could you advise?

        1 Reply Last reply
        0
        • V
          V
          Victor Kirhenshtein
          wrote on last edited by
          #8

          So you are trying to build agent for WinCE? Then yes, you need to compile it in UNICODE, because WinCE lacks non-unicode versions of most API calls.

          1 Reply Last reply
          0
          • S
            S
            szll2010
            wrote on last edited by
            #9

            Hi Victor

            Thanks. I noticed that some header files had been modified and I will try after the 1.1.0 is released.

            And I want to know how to deal with the IP address changing problem. For example, some devices are  in remote site and connected through carrier network. The node's IP address is not the same as last time connected. Does the agent register and server recognizes the agent then change the node's ip address, or there is other solution?

            1 Reply Last reply
            0
            • S
              S
              szll2010
              wrote on last edited by
              #10

              Hi Victor,

              Almost port the nxagentd to UNICODE for windows based the trunk version. Whether it is possible to port the dir relative structure members to TCHAR and dir.c to support TCHAR?

              1 Reply Last reply
              0
              • V
                V
                Victor Kirhenshtein
                wrote on last edited by
                #11

                Hi!

                I think it should not be very hard. I'll try to create TCHAR version of opendir/readdir/closedir today. I'll notify you when they will be done.

                Best regards,
                Victor

                1 Reply Last reply
                0
                • V
                  V
                  Victor Kirhenshtein
                  wrote on last edited by
                  #12

                  Wide version of opendir/readdir/closedir commited to trunk. Now you can use _TDIR, struct _tdirent, _topendir, _treaddir, _tclosedir.

                  Best regards,
                  Victor

                  1 Reply Last reply
                  0
                  • S
                    S
                    szll2010
                    wrote on last edited by
                    #13

                    Hi Victor,

                    Thanks for your port. Now the file system function works well.  I port the all the core agent and WINNT and winperf subagent to WINDOWS  UNICODE except the hddinfo has a bug.  Not really understand the  StrStrip function.

                    I also test the new config relative function, it can read ANSI and UNICODE content in the config file, but using the config->print function, it has problem with MBCS, like east asian characters. Could you check?

                    1 Reply Last reply
                    0
                    • V
                      V
                      Victor Kirhenshtein
                      wrote on last edited by
                      #14

                      Hi!

                      I don't understand what is the problem with Config::print. It uses wide character version of printf, so UNICODE build should print all characters correctly. Or you have problems with ANSI build?

                      Function StrStrip removes leading and trailing spaces and tabs from given string. It works in both ANSI and UNICODE builds. What exact problem you have?

                      Best regards,
                      Victor

                      1 Reply Last reply
                      0
                      • S
                        S
                        szll2010
                        wrote on last edited by
                        #15

                        Hi Victor,

                        I tested the new config API again but it does not work well with east asian characters.

                        The program is Unicode version, and the config's coding is UTF-8 and ANSI, in the config file there is some east asian characters. In  both scenarios,    the east asian characters became ?? under Config::print , the others are right.

                        Thanks

                        1 Reply Last reply
                        0
                        • S
                          S
                          szll2010
                          wrote on last edited by
                          #16

                          Hi Victor,

                          Sorry for mistake in the Config::print test using the setvbuf function to output. It should be OK.

                          Best regards,

                          1 Reply Last reply
                          0
                          • V
                            V
                            Victor Kirhenshtein
                            wrote on last edited by
                            #17

                            Hi!

                            Did you succeed with building UNICODE agent? If yes, it will be nice if you can share diff for converting agent to unicode - I then will be able to incorporate these changes to trunk and make unicode build as default option for Windows platform.

                            Best regards,
                            Victor

                            1 Reply Last reply
                            0
                            • S
                              S
                              szll2010
                              wrote on last edited by
                              #18

                              Hi Victor,

                              I do send this port to the community.  For the reason of windows port, I erased some unix codes in the source and I trim the nxagentd.cpp to a simpler version. Two subagents were ported , WINNT and WINPERF.

                              How to send the files to you?

                              best regards,

                              1 Reply Last reply
                              0
                              • V
                                V
                                Victor Kirhenshtein
                                wrote on last edited by
                                #19

                                Hi!

                                Send them to dump-at-netxms.org

                                Best regards,
                                Victor

                                1 Reply Last reply
                                0

                                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                With your input, this post could be even better 💗

                                Register Login
                                Reply
                                • Reply as topic
                                Log in to reply
                                • Oldest to Newest
                                • Newest to Oldest
                                • Most Votes


                                • Login

                                • Don't have an account? Register

                                • Login or register to search.
                                Powered by NodeBB Contributors
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • Users
                                • Groups