6 Replies Latest reply on Mar 8, 2017 11:23 AM by TSGal

    Char ( 0 ) Returns Empty String

    restored18

      I need to remove the unicode character #0 from a text field. However, Char ( 0 ) does not return a unicode 0 but an empty string. The #0 character is appearing in FileMaker fields that have text pasted from a PDF and I can't remove the characters in a substitute since Char ( 0 ) does not work.

        • 1. Re: Char ( 0 ) Returns Empty String
          TSGal

          restored18:

           

          Thank you for your post.

           

          Our Development and Testing departments are aware that Char (0) returns an empty string.

           

          If you perform a Code function on the string, does it show 0 (zero)?  Does the character get exported?

           

          Regardless, I have attached your post to the original report.  When more information becomes available, I will post again.

           

          TSGal

          FileMaker, Inc.

          • 2. Re: Char ( 0 ) Returns Empty String
            restored18

            When I run Code on the character it returns a 0, but if I run GetAsCSS, it returns <span style="" >&#0;</span>. GetAsCSS shows that the character is an HTML #0 character. Is there another way to generate this character in FileMaker to be used in a substitute?

             

            Thanks!

            • 3. Re: Char ( 0 ) Returns Empty String
              TSGal

              restored18:

               

              Thank you for the additional information.  I have added the information to the original report.

               

              I don't have a way to insert the null character into a FileMaker field, so I cannot test for a workaround.

               

              My initial thought for a workaround, since Code recognizes the null character, would be to copy the character to a variable, and then use the Substitute function with the variable.  For example, if the field is named "Field1", and in the current record, the third character is the null character, I would create the following script:

                Set Variable [ $null ; Middle ( Field1 ; 3 ; 1 ) ]

                Replace Field Contents [ Field1 ; Substitute ( Field ; $null ; "" ) ]

               

              Let me know if this works.  If not, I have asked Development and Testing for a workaround.

               

              TSGal

              FileMaker, Inc.

              • 4. Re: Char ( 0 ) Returns Empty String
                TSGal

                restored18:

                 

                Revisiting older posts, I realized there is a way to insert a null character into a FileMaker field.  Use:

                   Set Variable [ $null ; Value: Base64Decode ( "AA==" ) ]

                 

                Although this puts the null character into a variable $null, you could definitely use the Base64Decode function within a calculation to insert the null character.

                 

                Let me know if you need additional clarification.

                 

                TSGal

                FileMaker, Inc.

                2 of 2 people found this helpful
                • 5. Re: Char ( 0 ) Returns Empty String
                  mrwatson-gbs

                  If it is possible to create an ASCII 0 using the new Decode function, I find myself wondering why the Char function won't produce it? Is that may worth changing?

                  • 6. Re: Char ( 0 ) Returns Empty String
                    TSGal

                    mrwatson-gbs:

                     

                    Currently, FileMaker does not differentiate between empty and null.  Char (0) will return an empty string.  I have attached your post to the original report.

                     

                    Continue using Base64Decode ( "AA==" ) for the null character.

                     

                    TSGal

                    FileMaker, Inc.