unrecognizable characters in running gatling

The default encoding is UTF-8,my response’s encoding is GBK。
when I recoding with GBK the response’s was unrecognizable characters .
when I recoding with UTF-8 the response’s was normally and when running gatling simulation I print the response that saved in session it’s also to be unrecognizable characters…
That must be something wrong with my config.but I don’t know where is it .Can help me finger it out ? Thx.

Did you trying changing the encoding in gatling.conf?

在 2014年7月8日星期二UTC+8下午1时54分30秒,Stéphane Landelle写道:

Did you trying changing the encoding in gatling.conf?

The default encoding is UTF-8,my response’s encoding is GBK。
when I recoding with GBK the response’s was unrecognizable characters .
when I recoding with UTF-8 the response’s was normally and when running gatling simulation I print the response that saved in session it’s also to be unrecognizable characters…
That must be something wrong with my config.but I don’t know where is it .Can help me finger it out ? Thx.


You received this message because you are subscribed to the Google Groups “Gatling User Group” group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yes,I did that. I changed gatling.conf #encoding = “GBK” and changed recorder.conf #encoding=“GBK” and chose the recoding encoding “GBK” .When recoding my response string also unrecognizable characters . The follow is my response string:

<?xml version="1.0" encoding="GBK"?>net.sf.json.JSONArray1net.sf.json.JSONObjecttext<tr align='left'><td><a style='color:#0000ff' href='view.jsp?bookId=2'>銆婃?鑳芥祴璇曡繘闃舵寚鍗椻?鈥擫oadRunner 11瀹炴垬銆?浣滆?:闄堥渷</a>&nbsp &nbsp&nbsp<span style='color:red;'>娌℃湁搴撳瓨</span><div>銆婃?鑳芥祴璇曡繘闃舵寚鍗?LoadRunner 11瀹炴垬銆嬫槸涓?湰鍩轰簬HP LoadRunner 11宸ュ叿鐨勬寚瀵肩敤涔︼紝浠庢?鑳芥祴璇曞師鐞嗗埌宸ュ叿浣跨敤鍐嶅埌椤圭洰瀹炴柦锛屽叏闈粙缁嶄簡鎬ц兘娴嬭瘯鐨勫悇涓柟闈紝鍏跺唴瀹瑰熀鏈富绾胯鏄庡涓?#60;B>...</B></div></td></tr>value1

is the comment character!!!

You have to remove it that the line is taken into account!!!

I had removed “#” character and set encoding = “UTF-8” . but the output to console also be unrecognizable characters.

.exec(http(“request_8”)
.post("""/library/bfapp?sid=LibraryMgr""")
.headers(headers_4)
.body(RawFileBody(“RecordedSimulationGBK_request_8.txt”))
.check(
xpath("//map").saveAs(“new”)

)
)
.exec(session => {
println("******------------->"+session(“new”).as[String])
session
})

println string is:

******------------->net.sf.json.JSONObjecttext閵嗗﹥锟介懗鑺ョゴ鐠囨洝绻橀梼鑸靛瘹閸楁せ
锟介垾鎿玱adRunner 11鐎圭偞鍨妴锟芥担婊嗭拷:闂勫牓娓?/a>&nbsp &nbsp&nbsp濞屸剝婀佹惔鎾崇摠

閵嗗﹥锟介懗鑺ョゴ鐠囨洝绻橀梼
鑸靛瘹閸楋拷LoadRunner 11鐎圭偞鍨妴瀣Ц娑擄拷婀伴崺杞扮艾HP LoadRunner 11瀹
搞儱鍙块惃鍕瘹鐎佃偐鏁ゆ稊锔肩礉娴犲孩锟介懗鑺ョゴ鐠囨洖甯悶鍡楀煂瀹搞儱鍙挎
担璺ㄦ暏閸愬秴鍩屾い鍦窗鐎圭偞鏌﹂敍灞藉弿闂堫澀绮欑紒宥勭啊閹嗗厴濞村鐦
惃鍕倗娑擃亝鏌熼棃顫礉閸忚泛鍞寸€圭懓鐔€閺堫兛瀵岀痪鑳嚛閺勫骸顩ф稉锟?60;

I solved the problem with saveAs() and then get value from Session.

.body(RawFileBody(“RecordedSimulationOCX_request_42.txt”))
.check(bodyString.saveAs(“new”))
)

.exec(session=>{
println(session(“new”).as[String]) //println out value is normal.
session
})
thanks for the response.

So it turns out that Saxon doesn’t support GBK out of the box.

I’ve opened an issue: https://github.com/excilys/gatling/issues/2012

Thanks for reporting.

Done: https://github.com/excilys/gatling/issues/2012
So now Gatling falls back to JDK XPath (less efficient) if Saxon doesn’t support configured encoding.