karamjeet singh wrote:how can i convert string of any font to unicode in java
can any one help me ?
Well, your question has taught me something -- I had no idea, until I looked it up, that there was any such thing as a Unicode font; I was familiar with Unicode as a way of encoding characters, not representing them.
A font is a way of displaying characters; an encoding is a way of representing characters in (usually) binary. An "A" has a different value in ASCII, EBCDIC, and Unicode, but all of them still represent an "A".
I'm afraid your question is not specific enough to answer. For one thing, we don't normally think of "strings" as having "fonts"; a font is a visual representation of a string, and can be thought of as independent of the encoding of the string they display. In other words, if you see "abcde" on a computer screen, it is not possible to tell if the internal representation is encoded as Unicode, ASCII, or EBCDIC. Also, given a string of characters in any encoding, we can display that string of characters in any font that has the appropriate glyphs without changing the representation.
So we need to know more about what you want to do before we can help.
And I think the forum is much better at answering specific questions than it is broad, general, "how do I write this program" questions.
Ralph Cook wrote:Well, your question has taught me something -- I had no idea, until I looked it up, that there was any such thing as a Unicode font...
That's just a generalization of the folk taxonomy used by people who are basically ignorant of what Unicode is -- for many people a "Unicode character" is a character which they don't ever use in their computer. (It's surprising that some of those people come from places with Devanagari scripts all over their streets and yet they still think of Unicode as "everything except ASCII".) Extending that meaning of "Unicode character", a "Unicode font" must therefore be a font which can render lots of non-ASCII characters.
Joined: May 29, 2005
Actually, it appears to be a very specific font which does, in fact, have the overall purpose of rendering characters in many different scripts:
Looking in my Windows Fonts folder, I see an "Arial Unicode MS Regular" font is registered. Its size is 22MB, whereas most of the rest of the fonts are all only a couple hundred KB. So I suspect that that one font handles characters outside the usual ASCII range. (I also have numerous Han, Japanese and Korean fonts that are MBs in size; I don't know if they are Unicode based.)
hi thanks all for your feedback. I am displaying the unicode format for my website
I coded this and got from some forum but not able to work it
I want to show the language on website so anyone from mobile or from any place who show the website he will be able to view the website with his language selected as his selected font is installed on his machine.
Yeah, that code is an example of exactly the kind of ignorance I was describing. Java doesn't have any concept of "converting characters to Unicode" because its characters are already in Unicode. There isn't any option, Java characters are Unicode characters. That code is total rubbish. Throw it away.
Karamjeet, I think it would be a good idea if you explained your problem more fully. We have been chatting about fonts for the last two days and now you mention that you have a website. Is that website part of the problem?
karamjeet singh wrote:Unicode characters are platform(mobile & Win & mac readable) indepenedent right ?
Yes, Unicode is a specification which is independent of any platform. (I don't know what you mean by "mobile & Win & mac readable" though.)
I want this only for my company's website. when anyone click on one language(add it to session or cookie) like portuguese i make it convert the whole website to selected language.
Okay... so your website's users can choose what language the pages are displayed in.
I want to convert all the language to that font but dont want the user to have this font installed on his machine and not able to read the website
What do you mean by "convert all the language to that font"? What font? Why don't you just send the text and let the browser figure out what font to use? Browsers are very good at that, they already tend to use those "Unicode fonts" which can render scripts from all over the world.
What do you mean by "convert all the language to that font"? What font?
like facebook does http://www.facebook.com/ go to below of the page and you will see different languages
when you click on any of them whole page changes with selected language when you see this in firebug or view>page source
then you will find that exact language is there (no english words are in them)
But it sounds to me like Facebook can display its data in English or Russian or a variety of languages. Is that what you're saying?
If it is, then the answer to "how do they do that?" is "They hired people to translate their user interface to a variety of languages and then coded their application so that users could choose which language to read it in". This has nothing to do with fonts, by the way, or not much.
If you were hoping that you could choose a font and magically have it translate your web pages from English to Portuguese, well, that isn't going to happen.