Non-english character display as square box
Hi all,
I'm not very sure if this question should be asked here or in the JRE board, thus I'm trying here also
I have been trying an opensourced application called Alliancep2p (could be obtained from www.alliancep2p.com) using JRE 1.6 on an English Windows XP Pro machine.
The problem:
all chinese input are displayed as "square box". It looks like the programme "gets" the correct character, only that everything is displayed as "square box".
It looks like a font issue, though I'm not that sure. Is there anyway the default fonts could be changed, or to get the characters correctly displayed?
Note: I have east asian fonts installed, and the Java config panel can display chinese or other non-english characters correctly.
I tried the same application under GNU/Linux (locale is UTF-8) and chinese input/display correctly without any problem at all. Does it mean that it is not the problem of the application, or?
The original question in the JRE board:
http://forum.java.sun.com/thread.jspa?threadID=5265369&tstart=0
Thanks for all the input.
I'm not really sure if it's a problem of the application or not. But the fact that it works perfectly under Linux makes me think maybe it's not the problem of the program, and actually their developers said that unicode is being used all over the program and seems like they're not CJK users also.
I'm not a java guru so I can't really tell from the source if there's anything wrong.
Similar Messages
-
Chinese Character displayed as square box
I have been trying an opensourced application called Alliancep2p (could be obtained from www.alliancep2p.com) using JRE 1.6 on an English Windows XP Pro machine. The problem is all chinese input are displayed as "square box". Searching for a particular chinese phase works, only that everything is displayed as "square box". It looks like a font issue, though I'm not that sure. Is there anyway the default fonts could be changed, or to get the characters correctly displayed?
Note: I have east asian fonts installed, and the Java config panel can display chinese correctly.
I tried the same application under GNU/Linux (locale is UTF-8) and chinese input/display correctly without any problem at all. Does it mean that it is not the problem of the application, or?
Thanks for all the input.Hi,
Please check below notes which could be helpful for your issue
After Korean Language Installation Oracle Apps Displays All Characters As Squares [ID 731894.1]
Chinese Display as Square on the Form Menu after Apply NLS Patch 6678700_ZHT [ID 839957.1]
Chinese Characters are displayed as Empty Squares using Courier New Font [ID 578656.1]
Regard
Helios -
Newbie: Simplified Chinese characters are displayed as square boxes
Hi,
I am using Windows XP Simplified Chinese Version SP3, Sun JDK5.0 Update 20. I want to run Apache Ofbiz POS; however, the Chinese characters (zh) in PosUiLabels.xml are all displayed as square boxes.
I have tested run Ofbiz in Mac OS X and the Simplified Chinese are displayed normally, and other languages can also be displayed in Windows XP.
What should I do?
Regards,
Terence
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<property key="PosAdjustment">
<value xml:lang="en">(adjustment)</value>
<value xml:lang="es">(adjustment)</value>
<value xml:lang="fr">(ajustement)</value>
<value xml:lang="it">(adjustment)</value>
<value xml:lang="ro">(adjustment)</value>
<value xml:lang="zh">(调整)</value>
</property>
<property key="PosTotalReport">
<value xml:lang="en">TOTALS REPORT</value>
<value xml:lang="es">REPORTE TOTAL:</value>
<value xml:lang="fr">TOTAUX</value>
<value xml:lang="it">TOTALI STAMPA</value>
<value xml:lang="ro">TOTAL REPORT</value>
<value xml:lang="zh">合计报表</value>
</property>
<property key="PosTxId">
<value xml:lang="en">TXID</value>
<value xml:lang="es">Número de venta</value>
<value xml:lang="fr">N°vente</value>
<value xml:lang="it">IDTAX</value>
<value xml:lang="ro">IDTAX</value>
<value xml:lang="zh">交易号</value>
</property>
<property key="PosULogin">
<value xml:lang="en">Enter User ID:</value>
<value xml:lang="es">Ingrese su login:</value>
<value xml:lang="fr">Entrez votre identifiant :</value>
<value xml:lang="it">Inserire Id Utente:</value>
<value xml:lang="ro">Introduceti Id Utilizator:</value>
<value xml:lang="zh">输入用户 ID:</value>
</property>
<property key="PosUPassw">
<value xml:lang="en">Enter Password:</value>
<value xml:lang="es">Ingrese password</value>
<value xml:lang="fr">Entrez votre mot de passe :</value>
<value xml:lang="it">Inserire Password:</value>
<value xml:lang="ro">Introduceti Parola:</value>
<value xml:lang="zh">输入口令:</value>
</property>
<property key="PosUserNotManager">
<value xml:lang="en">User is not a valid manager!</value>
<value xml:lang="es">El usuario no es administrador válido</value>
<value xml:lang="fr">Cet utilisateur n'est pas un gérant !</value>
<value xml:lang="it">Utente non è un manager valido!</value>
<value xml:lang="ro">Utilizatorul nu este un manager valid!</value>
<value xml:lang="zh">用户非合法管理员!</value>
</property>
<property key="PosValidating">
<value xml:lang="en">Validating...</value>
<value xml:lang="es">Validando...</value>
<value xml:lang="fr">Validation...</value>
<value xml:lang="it">Validazione...</value>
<value xml:lang="ro">Validare...</value>
<value xml:lang="zh">确认...</value>
</property>
<property key="PosVoid">
<value xml:lang="en">Enter Order Number To Void:</value>
<value xml:lang="es">Ingrese número de orden a anular</value>
<value xml:lang="fr">Entrez le n° d'ordre à annuler :</value>
<value xml:lang="it">Inserire Numero Ordine Da Svuotare:</value>
<value xml:lang="ro">Introduceti Numarul Comenzii de Descarcat:</value>
<value xml:lang="zh">输入要作废的订单号:</value>
</property>
<property key="PosWaitingFinalSales">
<value xml:lang="en">Waiting for final sales data transmission...</value>
<value xml:lang="es">Esperando transmisión de datos...</value>
<value xml:lang="fr">En attente de transmission de données ...</value>
<value xml:lang="it">In Attesa di trasmissione dei dati vendite finali...</value>
<value xml:lang="ro">Asteptare pentru transmiterea datelor de vanzare finale...</value>
<value xml:lang="zh">等待最终销售数据传输...</value>
</property>
</resource>When you say "displayed" I assume you mean displayed in some GUI component. In which case you should assign a font to that component which can render those characters properly.
-
Reading a non-english character
Hi, I have a trouble with reading a non-english character from a html page.
I'm taking the word from the html page, and compare it with itself,
like this
string.equals("BİTTİ")
but it returns false.
is it possible to correct this?specify an encoding for your inputstream reader:
BufferedReader in = new BufferedReader(
new InputStreamReader(new FileInputStream("infilename"), "8859_1")); for example -
Getting a request in a non English character
Hi ,
In an attempt to solve a problem of getting a request in a non English character , i use the code , taken from O'Reilly's "Java Servlet programing" First edition:
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class MyServlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
try {
//set encoding of request and responce
req.setCharacterEncoding("Cp1255"); //for hebrew windows
res.setCharacterEncoding("Cp1255");
res.setContentType("Text/html; Cp1255");
String value = req.getParameter("param");
// Now convert it from an array of bytes to an array of characters.
// Here we bother to read only the first line.
BufferedReader reader = new BufferedReader(
new InputStreamReader(new StringBufferInputStream(value), "Cp1255"));
String valueInUnicode = reader.readLine();
}catch (Exception e) {
e.printStackTrace();
this works fine , the only problem is that StringBufferInputStream is deprecated .
is there any other alternative for that ?
Thanks in advance
YairHi Again ..
To get to the root of things , here is a servlet test and an http client test which demonstrates using the above patch and not using it :
The servlet :
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StringBufferInputStream;
public class Hebrew2test extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.setCharacterEncoding("Cp1255");
response.setCharacterEncoding("Cp1255");
response.setContentType("Text/html; Cp1255");
PrintWriter out = response.getWriter();
String name = request.getParameter("name");
//print without any patch
out.println(name);
//a try with patch 1 DEPRECATED
out.println("patch 1:");
BufferedReader reader =
new BufferedReader(new InputStreamReader(new StringBufferInputStream(name), "cp1255"));
String patch_name = reader.readLine();
out.println(patch_name);
//a try with patch 2 which doesn't work
out.println("patch 2:");
String valueInUnicode = new String(name.getBytes("Cp1255"), "UTF8");
out.println(valueInUnicode);
and now for a test client :
import java.io.*;
import java.net.*;
public class HttpClient_cp1255 {
private static void printUsage() {
System.out.println("usage: java HttpClient host port");
public static void main(String[] args) {
if (args.length < 2) {
printUsage();
return;
// Host is the first parameter, port is the second
String host = args[0];
int port;
try {
port = Integer.parseInt(args[1]);
catch (NumberFormatException e) {
printUsage();
return;
try {
// Open a socket to the server
Socket s = new Socket(host, port);
// Start a thread to send reuest to the server
new Request_(s).start();
// Now print everything we receive from the socket
BufferedReader in = new BufferedReader(new InputStreamReader(s.getInputStream(),"cp1255"));
String line;
File f = new File("in.txt");
FileWriter out = new FileWriter(f);
while ((line = in.readLine()) != null) {
System.out.println(line);
out.write(line);
out.close();
catch (Exception e) {
e.printStackTrace();
class Request_ extends Thread {
Socket s;
public Request_( Socket s) {
this.s = s;
setPriority(MIN_PRIORITY); // socket reads should have a higher priority
// Wish I could use a select() !
setDaemon(true); // let the app die even when this thread is running
public void run() {
try {
OutputStreamWriter server = new OutputStreamWriter(s.getOutputStream(),"cp1255");
//String query= "GET /userprofiles/hebrew2test?name=yair"; //yair in Englisg ..
String query= "GET /userprofiles/hebrew2test?name=\u05d9\u05d0\u05d9\u05e8"; //yair in hebrew - in unicode
System.out.println("Connected... your HTTP request is sent");
System.out.println("------------------------------------------");
server.write(query);
server.write("\r\n"); // HTTP lines end with \r\n
server.flush();
System.out.println(server.getEncoding());
server = new OutputStreamWriter(new FileOutputStream("out.txt"),"cp1255");
server.write(query);
server.flush();
catch (Exception e) {
e.printStackTrace(); -
How to validate for non-english character on a single line text field
In a "Single Line Text" field we would like to allow the users to enter alpha numeric values only. We should show error when the user enter non-English values like
carácter
Vijayaragavan, MCTSHi,
According to your post, my understanding is that you wanted to validate for non-english character on a single line text field.
I recommend to use jQuery to attach regular expression validation. Please refer to:
Using #jQuery to attach regular expression validation to a #SharePoint list form field
In addition, for custom validations you can create your own Types. Refer to
this[^] for creating custom field type
More information:
SharePoint Custom Field - Regex Validator
Thanks,
Linda Li
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Linda Li
TechNet Community Support -
Does querybuilder support non-english character?
I want to make query using querybuilder with non-english character (Chinese)?
I tried with http://localhost:4502/libs/cq/search/content/querydebug.html but it is not working.
below is my query string:
property=contenttext
property.value=你好嗎
I have converted the chinese character (你好嗎)to unicode.
Can anyone help me?That's a bug in the debugger UI. But it's easy to fix:
in crxde lite, overlay /libs/cq/search/components/querydebug/querydebug.jsp by copying it to /apps/cq/search/components/querydebug/querydebug.jsp
open /apps/cq/search/components/querydebug/querydebug.jsp
find the line "props.load(new ByteArrayInputStream(queryParam.getBytes("ISO-8859-1")));"
and replace with "props.load(new StringReader(queryParam));"
Will be fixed in 5.6.1. -
Error when import file with non-english character
Hi,<br /><br />I have images file with non-english character (unicode), for example ABC<X>.png where <X> is non-english character such as japanese, chinese, etc.<br /><br />Whenever I want to import the file to After Effects (right click -> import -> file), I always encounter error:<br /><br />Finding file/dir info for the file "C:\...\ABC?.png" -- file not found (-43) (3::30)<br />Can't import file "ABC?.png": unsupported filetype or extension. (0::1)<br /><br />My PC is Windows XP Professional 2002 SP2 English.<br /><br />How to solve this problem?<br /><br />Thanks
Adjust your system language settings. Proper file name conventions require a consistent Unicode environment, so install the respective foreign language support files or switch the language system-wide. Mixing different zones/ code ranges is always a bad idea. If your system is not in Japanese, AE will always misinterpret the characters and refuse to import. If that's not feasible, simply rename the files.
Mylenium -
Non-Latin Character Display On Web Page
In a Java web application, only one non-Latin character display issue is that when they are typied into a JSP file. Otherwise, non-Latin characters display correctly from the message property file or from database.
Anyone know how to solve it?
Thanks.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Solved!
Just need to have the JSP page tag on the related JSP file.
nullWelcome to our community, Denise
Perhaps check the names of all the files involved? What type
of web server are you using?
You say that your co-worker said she is linking to the skin
file from a .htm page, but what is missing here is whether she is
using the .HTM page you provided in the mix or if it's one she
created herself. If it's one she created herself, that may be the
issue.
Cheers... Rick -
Linux or JVM: cannot display non english character
hi,
i am trying to implement a GUI that supports both turkish and english. user can switch between them on the fly.
public class SampleGUI {
JButton trTranslate = new JButton(); /* Button, to translate into turkish */
/* Label text will be translated */
JLabel label = new JLable("Text to Be Translated!");
trTranslate.addActionListener (new ActionListener(){
void ActionPerformed(ActionEvent e){
String language="tr";
String country="TR";
Locale currentLocale;
ResourceBundle messages;
currentLocale = new Locale(language, country);
messages = ResourceBundle.getBundle("TranslateMessages",currentLocale);
/* get from properties file turkish match of "TextTranslate "*/
label.setText(messages.getString("TextToTranslate"));
Finally, my problem is my application does not display non english chracaters like "� ş � ğ � i" in GUI after triggering translation.However, if i do not use ResourceBundle and instead assign directly the turkish match for that label (i.e. label.setText("şşşşş")), GUI successfully displays turkish characters. what may be the problem? which encoding set does not conform?
ps : i am using redhat linux8.0, j2sdk1.4.1. current locale = "tr_TR.UTF-8". in /etc/sysconfig/keyboard , keyTable = "trq". There seems no problem for me as i can input and output
turkish characters. OS supports this. Also jvm gets the current encoding from OS.It seems as if there is a problem in reading properties file in inappropriate encoding.
thanx for dedicating ur time and effort,
hELinI would suspect it would work in vim only if vim supported the UTF8 character set. I have no idea if it does.
Here is one blurb I found on google:
USING UNICODE IN THE GUI
The nice thing about Unicode is that other encodings can be converted to it
and back without losing information. When you make Vim use Unicode
internally, you will be able to edit files in any encoding.
Unfortunately, the number of systems supporting Unicode is still limited.
Thus it's unlikely that your language uses it. You need to tell Vim you want
to use Unicode, and how to handle interfacing with the rest of the system.
Let's start with the GUI version of Vim, which is able to display Unicode
characters. This should work:
:set encoding=utf-8
:set guifont=-misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1
The 'encoding' option tells Vim the encoding of the characters that you use.
This applies to the text in buffers (files you are editing), registers, Vim
script files, etc. You can regard 'encoding' as the setting for the internals
of Vim.
This example assumes you have this font on your system. The name in the
example is for X-Windows. This font is in a package that is used to enhance
xterm with Unicode support. If you don't have this font, you might find it
here:
http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts.tar.gz -
Spool non english character names to a file
Hi There,
We have a table which has around a million rows. We just need to select two columns(out of which one is a name field with english and non english names) and spool the data to a file. The problem is that through sqldeveloper, if I choose csv or dsv option, the non english names, like chines charaters etc show up as question marks. Is there a better way or format to do this. I tries xls. But although it goes through successfully, when I open the excel file, it has nothing. I was able to do it for around 200000 rows in excel.
Any suggesstions?
Thanks,
Sun
Edited by: ryansun on Jun 23, 2012 4:24 AMryansun wrote:
Hi There,
We have a table which has around a million rows. We just need to select two columns(out of which one is a name field with english and non english names) and spool the data to a file. The problem is that through sqldeveloper, if I choose csv or dsv option, the non english names, like chines charaters etc show up as question marks. Is there a better way or format to do this. I tries xls. But although it goes through successfully, when I open the excel file, it has nothing. I was able to do it for around 200000 rows in excel.
Any suggesstions?
Thanks,
Sun
Edited by: ryansun on Jun 23, 2012 4:24 AMwhen dealing with non-ASCII characters, two different issues can exist,
1) data storage - incorrect byte value is stored
2) data presentation - incorrect character is displayed.
Can the utility utilized to view the *CSV file actually display the non-ASCII value properly?
can you inspect the *CSV file using an hexadecimal editor? what do you see inside the file? -
Identify Non English Character in a String
All,
We have a requirement to Identify the Non English Characters from the User Key In data and return an error message saying only valid English, Numeric and some special characters are allowed.
For Example, If the User enters data like "This is a Test data" then the return value should be true. or if he enters something like "My Native Language is inglés" then it should return false. Similarly any Chinese, russian or japansese character entryies should also return false.
How can we achieve this?
Thanks,
Nagarajan.Hi Nagarajan,
You could use Unicode character blocks or simply craft a regular expression that contains all the characters you need. The latter is easy to understand and gives you full control over which characters you want to allow. E.g. I assume you might want something like this:
if(!"This is a proper input string".matches("[\\s\\w\\p{Punct}]+")) {
// Issue error message and re-get input string
The String method matches() takes a regular expression as input parameter. If you haven't dealt with regular expressions before, check out the Java API help for class java.util.regex.Pattern. Here's a short breakdown of the pattern I used:
<ol>
<li>The square brackets [] enclose a list of allowed characters; here you can explicitly list all allowed characters.</li>
<li>You can specify ranges like a-z as a character class, list individual characters like ;:| or utilize predefined character classes (\s for any whitespace character, \w for all letters a-z and A-Z, underscore and 0-9 and the posix class \p for a list of punctuation symbols). For a complete list check Java API help on java.util.regex.Pattern.
<li>The + at the end indicates that the characters listed can occur once or more.</li>
</ol>
There's other ways to achieve what you want, but I think this might be an easy way to start with.
Cheers, harald -
Problem with Vcard and non-English character
VCard feature is what I would like to use, but I have quite a few contacts with Non-English name (Korean).
I know Ipod can display in Korean, but when I create a v-card with Korean character and copy the vcard file over into /contacts folder, I can see the filename as the person's name (From windows explorer), but I can ONLY see first character of the file when I display contacts in iPod.
Does anyone have tips/tricks on displaying all the filename in IPod contacts?
Thanks.
Windows XP ProBecause i use the string nota into a jsp page and i print the string nota into a textarea and the text is with no newline, example:
<textarea name="nota" rows="4" cols="60"><%= nota %></textarea>
the text into textarea is:
first linesecond linethird line
but i want that the text displayed into textarea is equal the text into the CDATA section:
first line
second line
third line -
I have pdf files in European languages and want to be able to enter non-English characters in the "find" function. How does one install other character sets for use with Acrobat Pro XI?
Have you tried applying the update by going to Help>Updates within Photoshop Lightroom? The update should be using the same licensing? Did you perhaps customize the installation location? Finally which operating system are you using?
-
Hot Sync with Non-latin Character Display Problem
I have a XP Home Desktop with Palm Desktop 4.01 installed. When I do a hot sync with my Sony Clie T655C, the chinese characters are display correctly in both XP home Desktop and the Clie.
Now, I have a netbook with window7 Starter installed for travelling use. It took me a while to resolve the problem on the hotsync with window 7 starter and sony clie. At the end, I have Palm desktop v6.2 and Palmhotsyncsetup from pimlico on the netbook. I am able to do a hotsync with cradle/cable, but not through network (with TCP/IP not listen error message).
I have installed the chinese, English, french IME for the window 7 Starter netbook. I am able to type Chinese character in Notepad and Word and display the character correctly. I am able to save the file ( filename in both chinese and english character), re-open it and all characters are displayed correctly.
But with Palm Desktop v6.2, I am able to type chinese and the characters are displayed correctly in calendar/data book. When I close the palm desktop and re-open it again. All the characters become "?", as a result, I can not fully evaluate the software Pimlico for window desktop. As it only works with Palm desktop v6.2.
Any suggestion?
Post relates to: Palm TXI have a XP Home Desktop with Palm Desktop 4.01 installed. When I do a hot sync with my Sony Clie T655C, the chinese characters are display correctly in both XP home Desktop and the Clie.
Now, I have a netbook with window7 Starter installed for travelling use. It took me a while to resolve the problem on the hotsync with window 7 starter and sony clie. At the end, I have Palm desktop v6.2 and Palmhotsyncsetup from pimlico on the netbook. I am able to do a hotsync with cradle/cable, but not through network (with TCP/IP not listen error message).
I have installed the chinese, English, french IME for the window 7 Starter netbook. I am able to type Chinese character in Notepad and Word and display the character correctly. I am able to save the file ( filename in both chinese and english character), re-open it and all characters are displayed correctly.
But with Palm Desktop v6.2, I am able to type chinese and the characters are displayed correctly in calendar/data book. When I close the palm desktop and re-open it again. All the characters become "?", as a result, I can not fully evaluate the software Pimlico for window desktop. As it only works with Palm desktop v6.2.
Any suggestion?
Post relates to: Palm TX
Maybe you are looking for
-
Any way to get .fla frame rate at runtime?
I would like to query at runtime to see what the frame rate of the .swf is set to. Is there a way to do this? I saw in help that you can access this for Camera, Netstream and Tween, but what about for the .swf itself? Thanks to anyone who can help.
-
I have a problem with dust on the monitor (iMac 27).
I have a problem with dust on the monitor (iMac 27). it appeared after half a year of use (in a clean room is not dusty). Replaced by a matrix of times under warranty. But after a while, again, there were shortcomings in the upper corners of the matr
-
HT4623 i want to lock my apps on i phone 4s ios 6, how ?
hello , i need help i want to lock my indivisual apps on i phone 4s . can some one can help me ?
-
AF:AUTOSUGGESTBEHAVIOR available in AF:QUERY
hi, the question is : when will AF:AUTOSUGGESTBEHAVIOR be available with AF:QUERY. Guess there is a Bug 12769579 (enhancement request) already raised for this. want to understand when would this be implemented and released with what version of ADF/JD
-
Smart Folder not recognizing color labels
I'm trying to set up a smart folder for photos that have a particular color label. It's not working for some reason. It works with ratings, and with flags, but not color labels. It's not a speed issue (I've come back to them hours later - still empty