• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    encoding problem of output at DiscoveryTest

    BACnet4J general discussion
    2
    6
    1.8k
    Loading More Posts
    • 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.
    • M
      mirvana
      last edited by

      I modified DiscoveryTest.java a little.
      That is, instead of System.out.println(pvs); of main() function, I substitued it with
      "for (ObjectIdentifier objectIdentifier : oids) {
      System.out.println(pvs.getString(objectIdentifier, PropertyIdentifier.description));
      }".

      Of course, I added "refs.add(oid, PropertyIdentifier.description);" at addPropertyReferences() function of the DiscoveryTest.java.
      But, the ouput encoding is not right at System.out, so breaked font strings are printed which is originally east asia character.
      So I want to know how to change encoding settings of PropertyValues or RequestUtils.readProperties().
      Any suggestions are appreciated.

      1 Reply Last reply Reply Quote 0
      • phildunlapP
        phildunlap
        last edited by

        Hi mirvana,

        I am not 100% certain, but I would guess the data type of these properties is a CharacterString? If so it looks like the encoding should be in the received ByteQueue. So, I wonder if there's a setting on the other device?

        It doesn't look like there's any way to set a character encoding setting more globally, but maybe I'm missing something. It looks like it prefers ASCII when it is doing something like setting the properties for rendering a BinaryValue, but that other encodings should be supported for reading.

        1 Reply Last reply Reply Quote 0
        • M
          mirvana
          last edited by mirvana

          Thank you for your answering.
          By the way, the return result of PropertyValues.getString() is String, not CharacterString.
          And, PropertyValues.getString() use Encodable, internally.
          But I got the hint that is changing the return string to CharacterString which has encoding setting, from your help.
          I' ll do it first and reply again.

          1 Reply Last reply Reply Quote 0
          • M
            mirvana
            last edited by mirvana

            I'm afraid that the way using CharacterString would be not likely working because I already had used the way of String.getBytes() which is not working and CharacterString.encode() use the way even though I use the function through CharacterString.writeImpl().
            I think maybe I have to use the matter about socket, because Bacnet4J use socket network.
            Any helps are appreciated.

            1 Reply Last reply Reply Quote 0
            • phildunlapP
              phildunlap
              last edited by

              I suspect you're right that it's the output stream. I googled for that and found this stack overflow thread, if it's helpful: https://stackoverflow.com/questions/14030811/system-out-character-encoding

              M 1 Reply Last reply Reply Quote 0
              • M
                mirvana @phildunlap
                last edited by mirvana

                Thank you.
                But the content of the link says it relates java option matter, it seems doubtful a little for me about it.
                I'll try it anyway.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post