Katalon Docker - Problem with encoding when checking text on the browser

Hello,

Currently we are facing an issue related with the encoding. Until now we have only english language in our application and it works fine.
We added vietnamese language and it looks working when running the test under Window with Katalon Studio. But our test pipeline is under Linux and we are using Jenkins and here it becomes tricky.

We have all messages in .properties files with UTF-8 encoding “normally” as I don’t work on the translation part.
The display looks OK in the browser under Katalon docker as shown in the screenshot below
image

However we get this error:
image

In our .properties file we have
locale_vi=Tiếng Việt

I guess the � is the letter with special accent that Katalon can’t read or decode correctly.

I guess there is a wrong encoding somewhere but I don’t know where.
Is it in my properties file or in the Katalon groovy script where I read the properties file content?
Do I need to force an encoding for language with special accent when reading text in Katalon groovy script?

I also check the setting in Katalon and the default encoding is UTF-8

Have everyone faced such similar issue with language encoding?

Thanks for your help.

It must be a bug of some GUI which displayed the gabled characters.

Where did you see this gabled characters?

In the Katalon Studio’s Console tab? In the LobViewer tab? or your own GUI app? Mobile App? your Web site?

Even if the settings is correct, any bug can be there. It is possible that a GUI component does not respect the general settings for encoding, or uses a font which lacks character griphs unique to Vietnamese.

Hi @kazurayam,
I got the gabbed characters from the Katalon Console output. The website displays correctly as shown in the screenshot.
I added extra output log in the Katalon groovy script to display what Katalon is getting when reading vietnamese language and I think the error is from here. Below what I got from the console output

getValueFromPropertyKey(): ===> result=Ti???ng Vi???t
unEscapeString(): ===> message=Ti???ng Vi???t

Wonder I my reading correctly the properties file? Below the function we are using to read and extract key value from properties file

	def getValueFromPropertyKey(File file, String propertyKey){
		def line, result = "";
		def lookupKey = propertyKey + "="
		def lookupKeyHasSpace = propertyKey + "\u0020"+"="

		if(file.exists()) {
			file.withReader({ def reader ->
				while ((line = reader.readLine()) != null) {
					if (line.startsWith(lookupKey)) {
						String[] values = line.trim().split('=',2)
						result = values[1]
						return
					}
					if (line.startsWith(lookupKeyHasSpace)) {
						String[] values = line.trim().split('=',2)
						result = values[1].trim()
						return
					}
				}
			})
		}else {
			println("File does NOT exist")
		}
		println("getValueFromPropertyKey(): ===> result="+result)
		result=unEscapeString(result)
		return result
	}

I also checked the setting and there is only 1 place (screenshot in my 1st post) where I can set the setting and it’s already set in UTF8

A Screenshot that captures the gabled characters in the whole window of Katalon Studio please.

This is necessary for Katalon Developers recognise exactly which software component is buggy.


However, I checked if Katalon Studio Console can display こんにちは世界 with Japanese characters. It worked fine. So, I guess Katalon Studio Console is NOT buggy.

Possibly your code has something wrong while reading a file that contains vietnamese characters.

How about trying alternative method signagure of File.withReader()

The display on the chrome browser under Katalon Docker is correct as shown below
image

When we are comparing label and text we realize that the text we got from the .properties contains ???
Below the screenshot of console output under Katalon Docker container

I am trying your alternative solution :crossed_fingers:

It works! Thanks so much @kazurayam. Very appreciated
Have a nice day :slight_smile: