Displaying UTF-8 based characters in data views

#1

KNIME Nodes save data for intermittent inspection. However UTF-8 based characters like '的' show up for me as 'çš„'; see attached picture. I have looked at DataColumnSpec and StringCell, but did not find any pointers regarding string encoding. How can I configure the cells in these tables to correctly display asian language characters?

Thanks,

rowi

0 Likes

#2

Are you sure that data has been read correctly in the first place?

0 Likes

#3
Thanks, yes the input data looks correctly processed. It should be replicable by:

protected BufferedDataTable[] execute(final BufferedDataTable[] inData, final ExecutionContext exec)
			throws Exception {
			
			final DataColumnSpec[] allColSpecs = new DataColumnSpec[1];
			allColSpecs[0] = new DataColumnSpecCreator("Chinese", StringCell.TYPE).createSpec();
			final DataTableSpec outputSpec = new DataTableSpec(allColSpecs);
			final BufferedDataContainer container = exec.createDataContainer(outputSpec);		
			final DataCell[] cells = new DataCell[1];
			cells[0] = new StringCell("汉语");
			final DataRow row = new DefaultRow("1", cells);
			container.addRowToTable(row);
			container.close();
			final BufferedDataTable out = container.getTable();
			return new BufferedDataTable[] { out };
}

Make sure that Preferences>General>Editors>Text Editors>Spelling>Encoding is set to UTF-8, to save the source files as UTF-8. I also made sure that Content Types and Text File Encoding is set to UTF-8, although that shouldn't be necessary.

0 Likes

#4

Have the same issue,all Chinese on my develop component are unreadable.

0 Likes