Node development Encoding problem

#1

I develop a datasource provide node,there are some Chinese on the UI,In development mode,all the Chinese display correctly
image

but i export the node and deploy to Knime installation Chinese unreadable.

image

0 Likes

#2

If you include a NodeLogger error/warning/… which dumps System.getProperty("file.encoding"); is it different between development and deployment?

0 Likes

#3

thanks,install & development on the same PC

0 Likes

#4

But if you run it in development, what does it say when you log that System.getProperty... and what does it say when you run it in deployment.

I ask, because it looks like Swing is picking up a different encoding between development and deployment. If you figure out the character encoding used in deployment, you could set up your String instances to work with the deployment.

0 Likes

#5

thanks,how to set character encoding in String instance?
I tried encoding Chinese input string,but not work.

String createString(String input) {
		try {
			return new String(input.getBytes("utf-8"));
		} catch (UnsupportedEncodingException e) {
			logger.error("not support utf-8 encoding");
			return input;
		}
	}
0 Likes

#6

Were there two different encodings? Which encoding did you see in deployment and which encoding did you see in development?

0 Likes

#7

encoding is the same GBK

            TSDBNodeModel:encodingGBK
            INFO  TSDBNodeModel                   鏂囦欢缂栫爜:GBK
            INFO  金风时序数据库              0:1        configure
            INFO  金风时序数据库              0:1        configure:encodingGBK

but all Chinese display unreadable including the Chinse output in the console like

      INFO  TSDBNodeModel                   鏂囦欢缂栫爜:GBK

I tried add

    -Dfile.encoding=GBK

and

     -Dfile.encoding=UTF-8

to knime.ini,not work neither.

It’s strange that those Chinese in Node Repository and node description display correctly

try this page suggestion,not work https://stackoverflow.com/questions/6891079/eclipse-rcp-wrong-encoding-when-deploying-the-product

0 Likes

#8

Aren’t these labels (above screenshot at least) taken from the factory XML?! Have you tried adjusting the encoding there in the <xml> declaration?

– Philipp

0 Likes

#9

No,all those unreadable text hard code in project,not read from xml

0 Likes

#10

Resolved。

update node version re-export re-deploy the node,everything work fine.:joy::joy::joy::joy::joy:

For those who visit the topic:
When you update your node,remember update the node version or your updates will not affect after you re-deploy your node to knime installation.

Just reviewed the whole issue,reset all settings to initial status.
if i do not check Use class files compiled in the workspace the UI Chinese text display unreadable.

0 Likes

#11

TIP - If you add .qualifier to the end of the version string, e.g. 1.0.0.qualifier, it will always update with a timestamp, even if you forget to add a new version number manually. Unfortunately, that isnt present be default, which is a common ‘gotcha’ with a new plugin.

Steve

2 Likes

#12

Here is another problem.
I add another node to the project,image

as the previous method to deploy node,the node did not display in the Knime node repository,Using the older jar(without new node) deploy,work correct.

0 Likes