HOME       >>       Programming

The Rtf Textbox Control, And Asian Characters If someone could shed some light...


Paradox

I'm currently working on a project for school. I have to make a program for a client, and my client is the head of the Japanese Dept.

I have run into a small problem however...

After finally managing to work out a way to actually get VB to display Asian characters, using the .textRTF property of the richtextbox control. But, in doing this, it turns it into something like this...

{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\froman\fprq1\fcharset128 MS UI Gothic;}{\f1\fnil\fcharset0 MS Sans Serif;}}\viewkind4\uc1\pard\lang1041\f0\fs17\'93\'fa\'96\'7b\'8c\'ea\lang5129\f1 \par}

Needless to say, this creates a slight difficulty for checking the input of the user against a stored value, i.e showing the user a word and getting them to write it in japanese.

So far, this hasn't been an issue, but in response to testing results, I had to increase the font size of the displayed characters. Of course, this affected the programs ability to compare both values, as one is now different to the other.

How can I get around this? Any help would be appreciated.

eiteljoh

not sure in vb, but have delt with these problems before. if you are comparing the values, i'd suggest either checking their hex or unicode values against eachother. the real problem with japanese is shift-jis is not a "standard", it's more of a thing. IBM/Microsoft, etc, have their own shift-jis codepages. so it makes this stuff really difficult, because who's codepage do you load?sorry, but you're in a whole heap of trouble )


vizskywalker

You could simply download a Japanese font and use that. I found a site with unicode Japanese fonts, many of which are TTF format, so hopefully they will help. I'm only guessing here because I haven't tested any of this, but the unicode font ought to allow you to check unicode values for different characters.


vizskywalker

Whoops, forgot the link to the unicode font site, here: http://forums.xisto.com/no_longer_exists/.


Paradox

Thanks man, that looks like it's going to work.The main issue was because the two richtext boxes were of a different font format (i.e centred, a few sizes larger...) but now, it appears that neither of these will matter, as I should be able to just compare the straight .Text properties.Thanks again.


vizskywalker

You're welcome, and let us know if it does work. If not I'll try to find something else for you. But when dealing with a text problem, I always check the fonts first, it is so frequently a problem that having sites with good fonts is worthwhile.



VIEW DESKTOP VERSION REGISTERGET FREE HOSTING

Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.