Skip to content

AppiumDriverLocalService.addLogMessageConsumer(Consumer<String>) supply garbled characters in chinese words , 中文字符乱码 #1617

@jasonjiang9527

Description

@jasonjiang9527

Description

AppiumDriverLocalService supply garbled characters in chinese words when call the method addLogMessageConsumer

Environment

  • Java client build version or git revision if you use some snapshot: java-client-v7.5.1.jar
  • Appium server version or git revision if you use some snapshot: 1.22.1
  • Desktop OS/version used to run Appium if necessary: win10
  • Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe: v16.13.0
  • Mobile platform/version under test: android8/11
  • Real device or emulator/simulator: UIAutomator2

Details

Code To Reproduce Issue [ Good To Have ]

when you use driver.findElementByXPath("//*[@text='发现' ]") , your log got this @text='¥マム￧ホᄚ'
image

        final AppiumServiceBuilder warn = new AppiumServiceBuilder().usingPort(port).withArgument(GeneralServerFlag.LOG_LEVEL, "info");
        final AppiumDriverLocalService appiumDriverLocalService = AppiumDriverLocalService.buildService(warn);
        appiumDriverLocalService.addLogMessageConsumer(s -> log.info("appium log: {}", s));
        appiumDriverLocalService.addLogMessageConsumer(s -> System.out.println(s));
        appiumDriverLocalService.start();

Exception Stacktraces

Please create a gist with the pasted stacktrace of the exception thrown by java.

Link To Appium Logs

Please create a gist which is a paste of your full Appium logs, and link them here. Do not paste your full Appium logs here, as it will make this issue very long and hard to read!
If you are reporting a bug, always include Appium logs as linked gists! It helps to define the problem correctly and clearly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions