diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsTCPSampler.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsTCPSampler.java index ef2dd15470..d63f3cc4ba 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsTCPSampler.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsTCPSampler.java @@ -242,7 +242,10 @@ public class MsTCPSampler extends MsTestElement { value = this.formatMockValue(value); if(StringUtils.isNotEmpty(this.getConnectEncoding())){ if(StringUtils.equalsIgnoreCase("utf-8",this.getConnectEncoding())){ - value = new String(value.getBytes(),StandardCharsets.UTF_8); + try { + value = new String(value.getBytes(),StandardCharsets.UTF_8); + }catch (Exception e){ + } }else if(StringUtils.equalsIgnoreCase("gbk",this.getConnectEncoding())){ try { value = new String(value.getBytes(),"GBK"); diff --git a/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue b/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue index 5b89ab2aca..dbc03a050c 100644 --- a/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue @@ -31,25 +31,33 @@