Uploaded image for project: 'ICU'
  1. ICU-13850

DecimalFormat should fail gracefully with empty string currency

    Details

    • tracOwner:
      shane
    • tracProject:
      ICU4C
    • tracReporter:
      shane
    • tracReviewer:
      andy
    • tracStatus:
      reviewing

      Description

      The ICU DecimalFormat setCurrency docs says:

      * @param theCurrency a 3-letter ISO code indicating new currency
           * to use.  It need not be null-terminated.  May be the empty
           * string or NULL to indicate no currency.
      

      However, my code in ICU 62 was written erroneously assuming that the string is always either nullptr or a valid 3-character code. A test case came up in which a user was calling the API with the empty string, causing a hard-to-debug test failure that didn't always reproduce.

      The fix is simple, and I will commit it to this ticket in a few minutes.

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                shane Shane Carr
                Reporter:
                shane Shane Carr
                Reviewer:
                Markus Scherer
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  tracCreated: