Can't set the Content-Type

Sorry, this may not work.

Please try changing the katalon.ini and see how it goes.

I am not sure. Characters-garbling problems are very much application specific, not theoretical, dirty stuff. Try-and-error, that’s only thing you can do. I can not help you very much by chatting remotely.

Or change your Web Server application not to use Shift-JIS, change it to UTF-8. That would definitely make your life easier.

@kazurayam

Please try changing the katalon.ini and see how it goes.

I confirmed by changing various things as below but did not work,

1.Change katalon.ini → -Dfile.encoding=Shift-JIS
2.Update dynamically using System.getProperty
3.Adding JAVA_TOOL_OPTIONS=-Dfile.encoding=Shift-JIS to an environment variable.

I am not sure. Characters-garbling problems are very much application-specific, not theoretical, dirty stuff. Try-and-error, that’s only thing you can do. I can not help you very much by chatting remotely.

そうですね、こちらまで情報いただいてありがとうございました。

Or change your Web Server application not to use Shift-JIS, change it to UTF-8. That would definitely make your life easier.

I will check what can be done.
Thank you

I suppose, all these 3 approaches require Katalon Studio Prefereces> General >Workspace > Text file encoding to be set “Default”, not “Other(selected encoding name)”.

If you choose “Other” then I think Katalon Studio will use the selected encoding rather than the value of System Property file.encoding.

@kazurayam

URL encoding issue has been solved as follows,
We can set the required URL encoding as follows,

Libraries:
import java.nio.charset.Charset as Charset
import java.net.URLEncoder

String random1 = “random word £500 tank \$”
String urlSJIS = “Example Domain” + URLEncoder.encode(random1, Charset.forName(“Shift-JIS”).toString())
WebUI.comment(“SJIS encoded URL”+urlSJIS)
String random2 = “random word £500 tank \$”
String urlUTF = “Example Domain” + URLEncoder.encode(random2, Charset.forName(“UTF-8”).toString())
WebUI.comment(“UTF-8 encoded URL”+urlUTF)

Output:
2021-02-19 10:47:36.259 INFO c.k.k.c.keyword.builtin.CommentKeyword - SJIS encoded URLhttps://example.com?random1=random+word+%81%92500+tank+%24
2021-02-19 10:47:36.261 DEBUG testcase.URLencoding - 9: random2 = “random word £500 tank $”
2021-02-19 10:47:36.263 DEBUG testcase.URLencoding - 10: urlUTF = “Example Domain” + URLEncoder.encode(random2, forName(“UTF-8”).toString())
2021-02-19 10:47:36.270 DEBUG testcase.URLencoding - 11: comment(“UTF-8 encoded URL” + urlUTF)
2021-02-19 10:47:36.272 INFO c.k.k.c.keyword.builtin.CommentKeyword - UTF-8 encoded URLhttps://example.com?random2=random+word+%C2%A3500+tank+%24

Thank you.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.