Kana characters? (was Re: [jdom-interest] HELP!)

Angela Amoateng angela.amoateng at kcl.ac.uk
Mon May 21 14:50:23 PDT 2007


Hi Grzegorz,

I found I had the same problem and realised they could be images 
instead of actual characters so I started to view the source of the 
charts until I found one Hiragana unicode chart, which was using actual 
fonts in the source code. I copied the character from the actual code 
and it seemed to work.

I checked against its hexadecimal value to ensure that it was correct.

This is the code in my XML document (by the way, romaji is romanised 
Japanese):

<?xml version="1.0" encoding="UTF-8"?>

<dictionary>
    <word>
        <noun>
            <english>book</english>
            <romaji>hon</romaji>
            <hiraganaSym>ほん</hiraganaSym>
            <hiraganaNum>&#x307B;&#x3093;</hiraganaNum>
        </noun>
               ...

And this was the output:

<?xml version="1.0" encoding="UTF-8" ?> <dictionary>
  <word>
     <noun>
        <english>book</english>        <romaji>hon</romaji>        
<hiraganaSym>ほん</hiraganaSym>        
<hiraganaNum>ほん</hiraganaNum>     </noun>

     ...

So I am thinking I will take the fonts from the source code of the 
Hiragana unicode chart, since its easier.

Thanks again for your help, really appreciate it!

Angela

Quoting Grzegorz Kaczor <grzegorz.kaczor at gmail.com>:

> Hi Angela,
>
>> For example, do  I copy and characters from the chart or do I have to
>> use the decimal and hexadecimal values to display them?
>
> It depends on the chart. Some charts can contain images in place of
> glyphs to be unambiguous and avoid any font-related problems. Then
> copying and pasting is of no use. You can either enter it from the
> keyboard (if you know how to do that, I don't) or try entering them as
> entities:
>
> <?xml version="1.0"?>
> <test>&#3041; &#1120;</test>
>
> However, I was unable to see the glyph (perhaps missing fonts).
> However, the second character appeared correctly.
>
> Regards,
> Grzegorz
>
>
>
> On 21/05/07, Angela Amoateng <angela.amoateng at kcl.ac.uk> wrote:
>> Hi again Grzegorz and Hi to Alan!
>>
>> Thanks for the input in regards to displaying Japanese characters! The
>> unicode chart has the decimal and hexadecimal values of the Hiragana
>> alphabet, but I just could not find how to actually implement it.
>>
>> For example, do  I copy and characters from the chart or do I have to
>> use the decimal and hexadecimal values to display them?
>>
>> I am playing around with both at the moment, so I will let you know how
>> I get on, but in the meantime, if anyone has an example of how it
>> should be done, I would appreciate it! =)
>>
>> Thanks again in advance!
>>
>> Angela
>>
>> Quoting Grzegorz Kaczor <grzegorz.kaczor at gmail.com>:
>>
>> > Hello,
>> > I believe that the XML APIs like JDOM, XOM and similar do
>> > notimplement their own UTF-8 or any other encoding and
>> > useJava-implemented encodings instead. And I believe that modern
>> > JavaUnicode implementation is based on Unicode 4.0 and Kanji is one
>> > ofimplemented scripts. So it should work.
>> >> Just out of curiosity, does someone have a sample of JDOM-generated
>> >> XML> that includes Hiragana and Katakana glyphs?   What about Kanji?
>> >>  Is this> done with the familiar encoding="UTF-8" at the beginning
>> >> or something else?
>> > I don't see anything extraordinary in creating an XML file with
>> > suchcharacters. You can just paste them from webpages to your Java
>> > editor,I believe. However, if your default system encoding is not
>> > UTF-8, youshould use a switch when compiling:
>> > javac -encoding utf8 Utf8Test.java
>> > If you have an XML file encoded with UTF-8, you can omit the
>> > encodingin the declaration - it is by default UTF-8. However if you
>> > use lotsof non-standard characters (for example, from outside of
>> > BMP), I wouldconsider using UTF-16 to decrease the file size.
>> > To be strict, glyphs are graphical representations of
>> > characters.UTF-8 and other encodings only encode Unicode character
>> > codes assequences of bytes. Even if you can process the characters
>> > using JDOMyou may be still unable to see them due to missing fonts,
>> > for example.
>> > Regards,Grzegorz
>> > On 21/05/07, Alan Deikman <Alan.Deikman at znyx.com> wrote:> Angela
>> > Amoateng wrote:> > 1)Does  JDOM recognise and create an XML document
>> > containing Japanese> > characters, specifically Hiragana? How will I
>> > go about this?> I have been using JDOM for quite a while with great
>> > success, but I> haven't really encountered this yet.>> Just out of
>> > curiosity, does someone have a sample of JDOM-generated XML> that
>> > includes Hiragana and Katakana glyphs?   What about Kanji?  Is this>
>> > done with the familiar encoding="UTF-8" at the beginning or something
>> > else?>>> --> Alan Deikman> ZNYX Networks>>
>> > _______________________________________________> To control your
>> > jdom-interest membership:>
>> > http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com>
>> >
>> > -- "Choć tyle wiemy własnym doświadczeniem:W nas jest Raj, Piekło
>> > - i do obu - szlaki."J.K.
>> > _______________________________________________
>> > To control your jdom-interest membership:
>> > http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
>> >
>>
>>
>>
>> --
>> Angela Amoateng
>> angela.amoateng at kcl.ac.uk
>>
>>
>
>
> -- 
> "Choć tyle wiemy własnym doświadczeniem:
> W nas jest Raj, Piekło - i do obu - szlaki."
> J.K.
>



-- 
Angela Amoateng
angela.amoateng at kcl.ac.uk




More information about the jdom-interest mailing list