The Burp Suite User Forum was discontinued on the 1st November 2024.

Burp Suite User Forum

For support requests, go to the Support Center. To discuss with other Burp users, head to our Discord page.

SUPPORT CENTER DISCORD

Japanese Characters are not copied properly

Sakura | Last updated: Jul 13, 2023 01:48AM UTC

Hi. I am trying to create a java burp suite extension using the Montoya API. I needed to copy the selected request and response from the HTTP History to the clipboard. But garbage values were displayed when I paste the values that contain Japanese characters. Sample: Copied using Ctrl+C <title>ページが見つかりませんでした</title> Copied when getting the response from event: <title>ページが見つかりませんでした</title> ------------------------------ I tried the following: 1. property file: pom.xml - added UTF-8 in the <properties><project.build.sourceEncoding> and <build><pluginManagement><plugin><encoding> 2. Java code snippet public List<Component> provideMenuItems(ContextMenuEvent event) { ... HttpRequestResponse requestResponse = event.messageEditorRequestResponse().get().requestResponse(); String response= new String(requestResponse.response().toString().getBytes(), StandardCharsets.UTF_8 ); ... } 3. Burp Suite - User Interface → Inspector and message editor → HTTP message display → Font = MS Gothic Can you tell me how to set the character encoding?

Hannah, PortSwigger Agent | Last updated: Jul 14, 2023 09:29AM UTC

Hi

When converting between Strings and bytes in Burp, data in multi-byte characters can get truncated. It's best to avoid conversion between the two where possible.

Could you try using the following code to generate your response String instead?
String response = new String(requestResponse.response().toByteArray().getBytes(), StandardCharsets.UTF_8);
Please let me know how you get on.

Sakura | Last updated: Jul 21, 2023 06:54AM UTC