How to display Chinese Character(s) in a image on a Linux platform?
Hi,
I have the following code that runs perfect on Windows XP system after I installed the Chinese fonts on it, and set the fontconfig file under jre.
What the program does is: load an image file, write some Chinese chars in it and redisplay the image, so that the image will contain the Chinese characters in it.
I ported the generating image with Chinese Characers part of code into a web application which the servlet returns the modified image to client. The web application is running on a linux box. However, when a user views the image on the browser, the Chinese chars are not well displayed (they are just several squares).
My question is, does the problem comes from the Chinese fonts settings on the linux system where the servlet is running on? And, how to fix the problem, any simple links on how to do that?
Thanks.
public void paint(Graphics g) {
ImageIcon photo = new ImageIcon("C:\\image.jpg");
Graphics2D g2 = (Graphics2D)g;
g2.drawImage(photo.getImage(), 0, 0, null);
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
Font font = new Font("Arial Unicode MS", Font.PLAIN, 16);
g2.setFont(font);
g2.drawString("¶", 140, 220);
}
"Arial Unicode MS" is the font provided by Microsoft, usually with MS Office products. I believe that's why those Chinese are rendered as square boxes on Linux. Either specifying some Chinese font available on your Linux box in the Font constructor, or using one of the logical fonts instead (for JDK5 and later) would help.
Naoto
Similar Messages
-
How can i display chinese character in asp?
---windows2003
---iis6.0
---oracle92010
---oo4o
oracle character set is we8mswin1252
sqlplus display chinese character normally.
when i export the oracle table into microsoft excel,the excel can display chinese character normally.
but when i write code in asp.The IE can not display the chinese character?
who would tell my why?
Message was edited by:
user525971Hi,
here's a link to the SQL Developer forum: SQL Developer
Frank -
Display Chinese character in iText
hi all I need to display Chinese character in my pdf file
I have iTextAsian.jar on my libraries , but the Chinese character did not show up
nested1.addCell(new Phrase(chinessname));I download freetype-2.1.10,
and I get ./configure --enable-static
./configure: make: not found
how to continue ... inorder to create your owner font
by the way I download the new extrajars-2.1.zip, this new jar supporting Chinese characters . but my first font is not working second font is work fine I don't know why?
first one
BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED); not working
//second one
BaseFont bfChinese= BaseFont.createFont("MSungStd-Light", "UniCNS-UCS2-H", BaseFont.NOT_EMBEDDED);
Thank you! -
How to display Chinese language?
There is a plan text file: article.txt, this file includes an Chinese article (Chinese Language).
The web server is English system.
Now I use a jsp file to display the content of this file, I use BufferedReader class to read the content of the file, then display it.
I use contentType="text/html;charset=gb2312" also, but it cannot display Chinese Character correctly.
Can anyone tell me how to display it?Hi i am having the same problem....how did you do it...can please help me
<pre>
<%@ page import="java.util.*,java.io.*,java.text.*,java.sql.* " %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<% response.setContentType("text/html; charset=UTF-8"); %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="Generator" content="TextPad 4.0" />
<meta name="Author" content="" />
<meta name="Keywords" content="" />
<meta name="Description" content="" />
</head>
<body bgcolor="#ffffff" background="" text="#000000" link="#ff0000" vlink="#800000" alink="#ff00ff">
<%
request.setCharacterEncoding("UTF-8");
String str1 = "\u7528\u6237\u540d";
String name = request.getParameter("name");
if(name != null) {
// instead of setCharacterEncoding...
name = new String(name.getBytes("ISO8859_1"), "UTF-8");
System.out.println(application.getRealPath("/"));
System.out.println(application.getRealPath("/src"));
%>
req enc: <%= request.getCharacterEncoding() %>
rsp enc: <%= response.getCharacterEncoding() %>
str1: <%= str1 %>
name: <%= name %>
<%
BufferedReader in = null;
ArrayList str = new ArrayList(100);
try {
in = new BufferedReader(new InputStreamReader( new FileInputStream("c:/Chinadescription\\coldtofu.txt"),"UTF-8"));
String line;
while ((line = in.readLine()) != null) {
line = line.trim(); //
if (line.equals("[stop]"))
break;
str.add(line);
finally {
if (in != null) {
try {
in.close();
catch (Exception e) {}
for (int i = 0 ; i < str.size(); i++) out.println(str.get(i));
%>
<form method="GET" action="testcharacter.jsp" encoding="UTF-8">
Name: <input type="text" name="name" value="" >
<input type="submit" name="submit" value="Submit" />
</form>
</body>
</html>
</pre> -
How to display Chinese on BB8900?
I have a BB8900 Curve with AT&T. I want to be able to display chinese character on my BB. Does anyone know how to do that? Thanks
There is advice in the link below that may be useful
http://tinyurl.com/yatket9
Blackberry Best Advice - Back-up weekly
If I have helped you please check the "Kudos" star on the right >>>> -
DSO content can't display Chinese character
Hello experts,
I extract data from non-sap system (non-unicode) to BW DSO (7.0 unicode).
The DTP, data extraction and the activation all work fine.
However, the content of the DSO can't display the Chinese character.
Is there any setting I miss?
How can it display Chinese character as the data in source system?
Any information is very appreciated.
Thanks in advance.Hi,
Make sure Chinese Language Patch applied on BW system. You can see Chinese does not mean Chinese Language Patch applied.
However, even if Language Patch is not applied, you still can see Chinese in reports via Portal.
Good luck
Jonas -
How to display Chinese in AWT (Urgent!)
I have to problems,
My computer is Win2K Traditional Chinese
I try to run an application which Display chinese characters on the component of AWT. Although the application can run and can display correctly, there are exceptions. It throws the following error continuously,
sun.io.UnknownCharacterException
sun.io.UnknownCharacterException
at sun.io.CharToByteISO8859_1.convert(Unknown Source)
at sun.awt.PlatformFont.makeConvertedMultiFontChars(Unknown Source)
at sun.awt.PlatformFont.makeConvertedMultiFontString(Unknown Source)
at sun.awt.windows.WToolkit.eventLoop(Native Method)
at sun.awt.windows.WToolkit.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
sun.io.UnknownCharacterException
sun.io.UnknownCharacterException
at sun.io.CharToByteISO8859_1.convert(Unknown Source)
at sun.awt.PlatformFont.makeConvertedMultiFontChars(Unknown Source)
at sun.awt.PlatformFont.makeConvertedMultiFontString(Unknown Source)
at sun.awt.windows.WToolkit.eventLoop(Native Method)
at sun.awt.windows.WToolkit.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I try to encodes the string as follow, however, it throws another exception
String x = new String("ChineseWordHere".getBytes("ISO-8859-1"), "Big5");
It throws exception:
java.io.UnsupportedEncodingException: Big-5
at sun.io.Converters.getConverterClass(Unknown Source)
at sun.io.Converters.newConverter(Unknown Source)
at sun.io.ByteToCharConverter.getConverter(Unknown Source)
at java.lang.String.getBTCConverter(Unknown Source)
at java.lang.String.<init>(Unknown Source)
at java.lang.String.<init>(Unknown Source)
at Test1.<init>(Test1.java:8)
at Test1.main(Test1.java:13)
Do you know how to solve these two problems??
(The most concern is that how to display Chinese in AWT)
ThanksFor starters, you shouldn't use the 8859 encoding since it only supports single byte representations. You should be able to successfully use UTF-8. Then to actually display the characters...or to type them, make sure you have an input method editor (IME) that supports the language - in theory if you are using a Chinese Win2k, you already have this with windows - just use the right font (I think MS Gothic should work) to show the characters. You might want to consider switching to Swing.
Good luck -
Display chinese character HTML in iPS3sp3
Hi there,
I am using iPS3sp3 and I modified it so that JSP can display chinese character correctly. But somehow I still can not display the chinese character in normal HTML.For instance, I put chinese character in Ldap.properties file but when user go to the Ldap login screen, the chinese can not be displayed correctly. The following is the modification I have done and can anybody please give me some help?
adding zh_TW in iwtPlatform-availableLocales
adding zh_TW in iwtPlatform-locale
adding BIG5 in iwtPlatform-HTMLcharset
adding ips.locale=en_US,zh_TW,zh_TW.BIG5 in platform.conf file
Setting, User's Default Locale: zh_TW
Setting, User's Default HTML charset: BIG5Finally, I made it work. The solution is pretty straight forward. All I need to do is to convert these kind of html file to utf8 encoded files and then, it works perfectly. Hope this might be useful for some people.
-
How to display greek character in adobe digital edition using urf-8
how to display greek character in adobe digital edition using urf-8
when i tried to open below link
https://websmp130.sap-ag.de/sap%28bD1lbiZjPTAwMQ==%29/bc/bsp/spn/bobj_download/main.htm
It's not opening & displaying access denied message as below.
403 Access denied
You do not have the permissions to access this resource
Error is logged with Tag:
Just want to know, Is it possible to display japanese characters on report using crystal report 8.5?
We've constraint to use only CR 8.5
Regds,
Kaushal -
How to display chinese on Nokia Xpress 5300?
How to display chinese on Nokia Xpress 5300? I have chinese and english songs together in my phone. but the phone cannot display chinese characters. Any solutions?
Sorry, my English is very pool.
1.My source code is edit on windows98SE/Chinese.
2.After compiler, My program can display Chinese on windows.
3.When change os to linux and use KDE, I can see Chinese in source.
4.If not create the "font.***.zh_TW" into /usr/.../lib,
AWT/SWING component can't display chinese.
5.If create the "font.***.zh_TW" into /usr/..../lib,
the AWT component can display chinese and SWING component can't.
6."LC_TYPE" is "zh_TW.Big5" and "LANG"="zh_TW.Big5".
7.If re-complier in linux, The SWING component can't display chinese.
8.When running, The system will display message
"Warning:Cannot covert string "-default-ming-medium-r-normal
-140---c-- big5-0".
9.use command "xlsfonts | grep big5" can find font "-default-ming-...-big5-0".
10.Check the "file.encoding" is "BIG5". -
How can I display Chinese Character correctly in JSP
<p>Dear Expert,</p><p>Now I develop web application which using CR report, the development tool is IBM RAD(rational) and the database is DB2 UTF-8. Because need user to input something in JSP, so the programmer use "GB2312" to convert to insert into the database. But when I create the crystal report and view in the web, the Chinese character can't disply correctly, like "???????", even I formated the font in report, doesn't work too.</p><p>And I set the report JSP charset to "GB2312" or "UTF-8", both of them failed. Following is my JSP seting:</p><p><%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%%></p><p>or <%@ page language="java" contentType="text/html;charset=GB2312" pageEncoding="GB2312"%%></p><p>And I think I must convert the data from database site firstly, then display, but I don't know where I can coding it and how to coding? Could any one tell me how to get it? </p><p>I use RAD(Rational) as development tools.</p><p>Thanks so much for your any comments. Many thanks!</p><p>Steven</p>
<p>Hi Steven,</p><p> It sounds like you are on the right track to get the Chinese data to appear up correctly in the report. Can you tell me if you are using the JSF viewer or the JSP viewer?</p><p>From what the developers are telling me the following should work:</p><p class="MsoNormal"><font face="Arial" size="2" color="navy"><span style="font-size: 10pt; color: navy; font-family: Arial">For JSP viewers to set content type correctly you can either use</span></font></p> <p class="MsoNormal"><font face="Arial" size="2" color="navy"><span style="font-size: 10pt; color: navy; font-family: Arial"><%@ page contentType="text/html;charset=UTF-8" %></span></font></p> <p class="MsoNormal"><font face="Arial" size="2" color="navy"><span style="font-size: 10pt; color: navy; font-family: Arial">Or</span></font></p> <p class="MsoNormal"><font face="Arial" size="2" color="navy"><span style="font-size: 10pt; color: navy; font-family: Arial">response.setContentType("text/html;charset=UTF-8âu20AC)</span></font></p> <p class="MsoNormal"><font face="Arial" size="2" color="navy"><span style="font-size: 10pt; color: navy; font-family: Arial">or </span></font></p> <p class="MsoNormal"><font face="Arial" size="2" color="navy"><span style="font-size: 10pt; color: navy; font-family: Arial">simply call viewer.setOwnPage(true); if it not necessary to blend with other pages.</span></font></p> <p class="MsoNormal"><font face="Arial" size="2" color="navy"><span style="font-size: 10pt; color: navy; font-family: Arial"> </span></font></p> <p class="MsoNormal"><font face="Arial" size="2" color="navy"><span style="font-size: 10pt; color: navy; font-family: Arial">For JSF viewer the third option is not available.</span></font></p><p class="MsoNormal">What does your JSP page code look like? Also, what does the output look like?</p><p>Finally, one last thing is to ensure that the font you are using in the report is available to the engine at runtime. This will mean that it wll need to be installed on the application server where your JSP page is running. Give this a try and let me know what you find. </p><p>Regards,<br/>Sean Johnson (CR4E Product Manager) <br/><br/> Rate this plugin @ Eclipse Plugin Central </p>
-
Need help in Displaying Chinese Character in JSF
Hi. Good Morning!
I'm having problem with displaying Chinese Characters in JSF. I've tried placing all the chinese words in the *.properties file however it doesn't work..
The result in the browser is something like this.
���� ��������� ���� ��������� ���� ���������Hi,
When you say that you put Chinese characters in
*.properties files, can you be more specific? Did
you use native2ascii to convert the files to ASCII?
What is the character encoding setting for the JVM?
Have you sniffed the HTTP headers? If so, what's the
character encoding listed for the response?
Answers to these questions should help you nail down
the problem.
Regards,
PeterHi...
I did not use any converter like native to ascii... an example of what I placed in the properties file is:
title : 以下5种标签的表面要求列样
Request=条码离边框
Tablehead=透明标签
Note1= 透明标签
Note2= 透明标签
NoteA= 印商标图
then when i build the project in linux it turns out to be like this:
title= ???
Request=???
Tablehead=???
Note1= ???
Note2= ???
NoteA= ???
The character encoding for JVm.. i haven't check that yet nor know how... -
Display Chinese Character in SQLPLUS
Anyone have any idea how to display a chinese character from the database? Is it possible to display from sqlplus.
nullIt is possible to display Chinese characters in SQL*Plus. The reference manual at http://www.oradoc.com/ora817/server.817/a76966/toc.htm would be a good starting place to learn more.
- CJ -
How to display Chinese characters in Oracle?
I am using Oracle 8i with Language settings as AMERICA.
I am displaying records which is contain Chinese characters.
But it is not displayed properly in Oralce.
How to change the settings to display Chinese characters?
ThanksIt could be possible to display Chinese characters using SQL Developer without any specific NLS_LANG setting because SQL Developer is using JDBC which doesn't use NLS_LANG setting according to When is NLS_LANG used ?.
For example, I'm able to display the following Chinese character in SQL Developer 1.2.0 on Windows XP Pro with French Windows setting and NLS_LANG set in Windows registry to FRENCH_FRANCE.WE8ISO8859P1.
select unistr('\8349') from dual;
草
[pre]
Message was edited by:
Pierre Forstmann -
How to display chinese word when i logon in EN?
Hi!
I have a report that can upload an excel file using BAPI. Excel file will be extracted to an internal table at first and this excel file will contain chinese characters. When I logon to EN and run the report, I debug the internal table and found that my chinese characters become ????. But if i logon on chinese - ZH, i can see them clearly.
however, for the same report, I tested on my friend's PC (vendor company). He logon to EN as well, but can see the chinese character very clearly.
I check on RZ10, his development server profile has zcsa/system_language = E, zcsa/installed_languages = 12DEMH
My develpment server is zcsa/system_language = E, zcsa/installed_languages = 12DEMZH
My friend as an ABAPer has no idea on how the settings in developemt server work. Did I miss out somethings that disallow me to see the chinese characters in an internal table when i logon in EN?
Can anyone help me to figure out this problem? Thanks a lot!
best regards,
ying yingHi!
I know the reason I can't see chinese characters during debugging if I logon to English SAP system.
I should click "Customizing Local Layout" at application bar --> Character Set --> Simplified Chinese. Those chinese characters that appear in ??? while debugging will change to proper chinese characters and uploaded successfully.
If I go to FB03 and see the chinese characters in »áÒéÆڼ俧·È·ÑÓÃ, perform the same steps and those weird code will change to proper chinese as well.
Thanks for all the replies and help. It's very appreciated. Thank you very much!
Best regards,
ying ying
Maybe you are looking for
-
Error 1430 when adding a new VI to the program
I have a program I developed in LV 2009 in 2009 and now I am updating it. I accidently opened it up in 2010 and saved it. There are Microsoft office tools that were built into LV 2009 that are removed in 2010 that I had used in my program. So I ha
-
MSI GE620DX pls HELP WILL BE APPRECIATED
Help, just yesterday i got this issue with my ge620, upon startup, instead of blue light on power button, its stuck in red which is the nvidia graphics.... my lappy is overheating up[on strtup.. i already updated the bios which is the latest 10R.. an
-
How to use to_Char in obiee
Evaluate( 'to_char(%1,%2)' as char,SUM(EQ_HOLDING_FACT.shares),'FM999,999,999,990') A general error has occurred. [nQSError: 42015] Cannot function ship the following expression: Evaluate( to_char(%1,%2),D1.c18, 'FM999,999,999,990') how to resolve it
-
My ipod will not sync fom library to ipod. The sync option is not hilighted. What do I do now?
-
Strange! null reference in a String witch shouldn't be null
I have a bug that really I dont understand. I get un Id from a database with a select query. and i check that is correctly gotten. then i set this Id in a static attribute of a class. fro example: Test.setId(_id); when i want to insert this id in a s