Jump to content
xisto Community
Paradox

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

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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 :D)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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. :angry:

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.