Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unicode related

 
Gursewak Singh
Ranch Hand
Posts: 79
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 436
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 79
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Hauke,
Itried it with Google Translate API. but some errors are their please clearify it.
My code is..


 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you going to tell us *what* errors are occurring, or are we supposed to guess?
 
Gursewak Singh
Ranch Hand
Posts: 79
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 79
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 79
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have download google-api-translate-java-0.95.jar .but still above error are rising
 
Hauke Ingmar Schmidt
Rancher
Posts: 436
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 79
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sir what are these official APIs please give some example
 
Hauke Ingmar Schmidt
Rancher
Posts: 436
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Google Translate API
 
Gursewak Singh
Ranch Hand
Posts: 79
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Respected Sir,
How can i use this in my program???
please give some basic idea i am not getting.
 
Gursewak Singh
Ranch Hand
Posts: 79
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think what you are telling me is related to web application.
but i want to design a desktop application.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 79
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.. ..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic