aspose-cells / Aspose.Cells-for-Java

Aspose.Cells for Java examples, plugins and showcases
https://products.aspose.com/cells/java
MIT License
148 stars 102 forks source link

Aspose.cells.gridweb-java Chinese garbled #58

Closed huosenyuan closed 3 years ago

huosenyuan commented 3 years ago

image

amjad-sahi commented 3 years ago

@huosenyuan,

Please zip and share your Excel file, we will check it soon. Also, you may post your issue with sample file (zipped archive) as attachment in the Aspose.Cells forum.

huosenyuan commented 3 years ago

data.zip this is excel file

huosenyuan commented 3 years ago

I use it Examples.GridWeb , access the EXCEL form of Chinese content, and display garbled code in the browser.

huosenyuan commented 3 years ago

Oh, by the way, the example code does not add a license file; when there are multiple sheet pages switching, it can't switch.

amjad-sahi commented 3 years ago

I opened your file into MS Excel 2016 and found this display as in the screenshot. So, I found no Chinese chars shown in the cells.

huosenyuan commented 3 years ago

image

huosenyuan commented 3 years ago

data.xls

huosenyuan commented 3 years ago

Examples.GridWeb.zip image

amjad-sahi commented 3 years ago

@huosenyuan,

I did test your scenario/case in a separate web project using latest Aspose.Cells.GridWeb for Java v21.3 with its latest resource files (please use latest files in acw_client folder of Aspose.Cells.GridWeb for Java v21.3) in eclipse. I used a simple .jsp page having following source code. It simply imports the “chineseData.xls” file into GridWeb and it works fine. e.g. Sample code:

%@ page language="java" contentType="text/html; charset=UTF-8"
 import="com.aspose.gridweb.*,java.io.*" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>

<%
ExtPage BeanManager=ExtPage.getInstance();
BeanManager.setServlet(request, response);
BeanManager.setPageaction( request.getContextPath()+"/GridWebServlet"); 
BeanManager.setPageajaxcallpath(request.getContextPath()+"/GridWebServlet?acw_ajax_call=true"); 
GridWebBean gridweb=BeanManager.getBean();
gridweb.setACWClientPath("../grid/acw_client/");
%>
<%@include file="/head.jsp" %>
</head>
<BODY>
<%
gridweb.setEnableAsync(true);
gridweb.setRenderHiddenRow(true);
gridweb.setWidth(Unit.Pixel(1200));
gridweb.setHeight(Unit.Pixel(600));
 String file="f:\\Files\\online excel viewer\\WebContent\\file\\chineseData.xls";

gridweb.importExcelFile(file);
 gridweb.prepareRender();
out.println(gridweb.getHTMLBody());
  %>
  <br>

</BODY>
</html>

I am using Tomcat v7.0 server with JDK1.7 and Google chrome browser type. See the screenshot attached that shows Chinese chars are displayed fine. https://i.imgur.com/G9udg5x.png

Which browser type you are using? Please note, it does not look good in eclipse IDE editor.