Uploaded image for project: 'SLF4J'
  1. SLF4J
  2. SLF4J-52

MessageFormatter does not escape backslash

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • None
    • None
    • Core API
    • None
    • Operating System: All
      Platform: All

    Description

      I can't put a backslash in front of my substituted argument.

      Some tests:

      System.out.println(MessageFormatter.format("C:{}", "foo"));
      Prints "C:foo"

      System.out.println(MessageFormatter.format("C:{}
      ", "foo"));
      Prints "C:foo\"

      System.out.println(MessageFormatter.format("C:
      {}", "foo"));
      Prints "C:{}"

      System.out.println(MessageFormatter.format("C:\\\\{}", "foo"));
      Prints "C:{}"

      There seems to be no way to print "C:\foo".

      Attachments

        Activity

          People

            slf4j-dev SLF4J developers list
            chrisahn@gmx.net Christopher Sahnwaldt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: