File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Unicode related Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Unicode related" Watch "Unicode related" New topic
Author

Unicode related

Gursewak Singh
Ranch Hand

Joined: Jan 09, 2011
Posts: 79

Hello everyone
I am trying to design a language translator.
so i have a problem related to that
i am using eclipse IDE with ubuntu.
their is a problem to print a character using Unicode,most of the characters are printed (like English alphabet) but some of them are not (like Gurmukhi character).
so please tell me the solution for it And also give some idea to design a simple language translator.
Hauke Ingmar Schmidt
Rancher

Joined: Nov 18, 2008
Posts: 371
The problem could be anywhere where you transform strings. Your output mechanism has to fully support it, including the fonts to present the data which must include the glyphs needed. Outputting to the console may fail.

For a "simple" language translator: Call the Google Translate API.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

storing the character is only one part, another part is whether the application displaying the character
1) knows what the encoding is
2) knows how to display that encoding
Gursewak Singh
Ranch Hand

Joined: Jan 09, 2011
Posts: 79

Dear Hauke,
Itried it with Google Translate API. but some errors are their please clearify it.
My code is..


Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39549
    
  27
Are you going to tell us *what* errors are occurring, or are we supposed to guess?


Ping & DNS - updated with new look and Ping home screen widget
Gursewak Singh
Ranch Hand

Joined: Jan 09, 2011
Posts: 79

package com.google.api.translate;
import com.google.api.translate.Language;
import com.google.api.translate.Translate;

Is it reqired to add these packages explicitly???
Gursewak Singh
Ranch Hand

Joined: Jan 09, 2011
Posts: 79

Main [Java Application]
Main at localhost:49834
Thread [main] (Suspended (exception ClassNotFoundException))
URLClassLoader$1.run() line: not available
AccessController.doPrivileged(PrivilegedExceptionAction<T>, AccessControlContext) line: not available [native method]
Launcher$AppClassLoader(URLClassLoader).findClass(String) line: not available
Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: not available
Launcher$AppClassLoader.loadClass(String, boolean) line: not available
Launcher$AppClassLoader(ClassLoader).loadClass(String) line: not available
C:\Program Files\Java\jre6\bin\javaw.exe (Apr 17, 2011 10:29:48 AM)
Gursewak Singh
Ranch Hand

Joined: Jan 09, 2011
Posts: 79

I have download google-api-translate-java-0.95.jar .but still above error are rising
Hauke Ingmar Schmidt
Rancher

Joined: Nov 18, 2008
Posts: 371
You are using an unsupported third-party API that seems to be outdated. AND you are missing one important line from their sample code.

Just use it via the official REST API. There are samples for Java at the official page.
Gursewak Singh
Ranch Hand

Joined: Jan 09, 2011
Posts: 79

Sir what are these official APIs please give some example
Hauke Ingmar Schmidt
Rancher

Joined: Nov 18, 2008
Posts: 371
Google Translate API
Gursewak Singh
Ranch Hand

Joined: Jan 09, 2011
Posts: 79

Respected Sir,
How can i use this in my program???
please give some basic idea i am not getting.
Gursewak Singh
Ranch Hand

Joined: Jan 09, 2011
Posts: 79

I think what you are telling me is related to web application.
but i want to design a desktop application.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39549
    
  27
Gursewak Singh wrote:I think what you are telling me is related to web application.

No, you can use a REST API from within a desktop app just fine.
Gursewak Singh
Ranch Hand

Joined: Jan 09, 2011
Posts: 79

Ok
Thank you sir.
now i have started studying your link.
hope it will be helpful...
So thanks again for giving me your important time.

if I found any problem related to it then I shall again disturb you.. ..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unicode related
 
Similar Threads
Aboout language translator
Unicode Problem
Help required : unicode representation
How to get unicode for a character?
how to remove strange control characters from a string