jmeter 默認的編碼是ISO-8859-1,無法表示中文字符。如果系統采用的編碼與jmeter編碼不一致,中文字符就會顯示亂碼。
request 請求中中文顯示亂碼
解決方案:在http請求配置中content encoding設置為utf-8
response 響應中存在亂碼
解決方案一:
在線程組上右鍵添加---后置處理器---BeanShell PostProcessor
在Script中填寫prev.setDataEncoding("UTF-8"),
保存后重新運行響應結果中文顯示正常。
解決方案二:
進入jmeter/bin目錄下,打開文件jmeter.properties、搜索default.encoding
'''#sampleresult.default.encoding=ISO-8859-1 去掉注釋、把ISO-8859-1修改成UTF-8,保存后重啟jmeter, 再次運行ok