Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 300
  • Last Modified:

How to provide supports for far east?

Hello!
    I'm making an editor, but it doesn't support far east characters. If a editor supports, any double-byte character in the editor can be normally displayed, and normally deleted (if not, pressing backspace will delete only a half of the character). How to do it?
    Thank you!
0
prefix
Asked:
prefix
  • 20
  • 18
1 Solution
 
MichaelSCommented:
It's compleatly not clear what are you trying to do :(
Can you provide more details about your implementation?
Which controls do you use, is it win32 app, MFC......

In any cases you can check MSDN, it has complete documentation about subj.
0
 
prefixAuthor Commented:
Hi MichaelS,

Many controls like TextBox are unable to display double byte characters if it was set with a English font(but it can display double-byte chars after setting a double-byte font, like Japanese font, Chinese font...), and many of the controls are unable to display normally even setting a double-byte font, like UltraEdit.

This is the problem. Controls doesn't not supports double-byte characters.

But, some editors supports, like EmEditor, EditPlus...Typing double-byte characters in them are the same as single-byte characters (All texts are up to snuff).
They can display double-byte characters event setting with a English font, which need to do is the operating supports(use a far east OS).

Do you know what I'm talking about? I need to let my editor display characters like EmEditor displays - No problems for a far east user to use.
0
 
MichaelSCommented:
>Controls doesn't not supports double-byte characters

In my apps I used static, editbox and richedit controls and have no problems with DBS. Sure you have to select font which can do it.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
prefixAuthor Commented:
Hello, MichaelS
    Sorry for the delay, my site was hacked so I have to re-build it first.
    I didn't mean the static, edit box or richedit controls. I mean a View. What do I need to do for a View to support DBS? What things do I need to precaution?
0
 
MichaelSCommented:
>I mean a View

Sorry, what do you mean by view?
0
 
prefixAuthor Commented:
oh, sorry, "I mean a CView".
I didn't use CRichView as usual, I'm trying to write a view derived from CView. I have no ideas of counting characters, getting the width of a character, the length of a line, etc. Because one line of text might include some double-byte characters and some ascii characters, and many characters don't have the same width...
0
 
prefixAuthor Commented:
oh, and I don't know how to process the double-byte characters (delete, save and etc.).
0
 
MichaelSCommented:
>I'm trying to write a view derived from CView

OK, that's clear, and do you have some problems with that? Did you tried how it works with DBS? As I know sould be no problems.
0
 
prefixAuthor Commented:
please wait, I'll make a screenshot for you.
0
 
prefixAuthor Commented:
Hi, MichaelS, have a look at this two pictures:
http://www.neocactus.com/nodbs.gif
http://www.neocactus.com/nodbsj.gif
0
 
MichaelSCommented:
Ok, I did.
So looks like either you don't have right font or you don't use _MBCS in proprocessor definitions (in projects settings).
0
 
prefixAuthor Commented:
Oh, I'm sure I have right font.
And I've just tried use _MBCS in processor definitions. (but I'm not sure which...so I add it to both MIDL and c/c++) but nothing changed after a rebuild all.
And I don't know how to count the length of the whole line.

BTW: I'm using a Japanese OS, it has a Japanese input method. The input method can recognize whether the input window supports DBS, if the input window does not supports, it will display Japanese characters in its own window when inputting. So, I know the input window of my program does not support DBS.
0
 
MichaelSCommented:
Hmmm. May be CView really doesn't supports DBS :(
can you do some tests, put edit control and check does it works in your project or not. Than we will know is the problem in CView or in project generally.
0
 
prefixAuthor Commented:
Hi MichaelS,
The edit control works fine with DBS.
I think CView doesnot supports DBS - To make it support is our work.
0
 
MichaelSCommented:
:(
no luck with CView than
If your all sould work only under WinNT may be you can use UNICODE?
0
 
prefixAuthor Commented:
My program need to work under both NT and 98...
I've heard some programs support UNICODE, and they work fine under both NT and 98...ahh...EmEditor, do you know this editor?
Or may we transfer the problem to..."How to make a UNICODE program under NT and make it work fine under 98"?
Or other ideas???
0
 
MichaelSCommented:
>How to make a UNICODE program under NT and make it work fine under 98

UNICODE programs works only under NT/2k, no 9x
I think you have to write your own CView class
0
 
prefixAuthor Commented:
So, we return to this question..
0
 
MichaelSCommented:
From MSDN I found:

>MFC is fully enabled for writing applications that use Unicode? and multibyte character sets (MBCS), specifically double-byte character sets (DBCS).

So CView sould support it. Looks like we some some error in your setting or code. Can you show some code?
0
 
prefixAuthor Commented:
Hi, MichaelS:
I'm glad to show you the code but I'm just a beginner of VC, the code is complex for me, I don't know what I can show, so I express it in natural language...
I use a CArray to store the characters when we key in, the array store line by line, and use a bitmap to display the characters, I use textout to draw it to the bitmap and then copy it to the view....ouch, just only it...I think the problem is I use the CArray to store each character, so a double-byte character might be seperated...
Can you tell me what functions different from ansi functions to use if a app needs far east support?
0
 
MichaelSCommented:
>Can you tell me what functions different from ansi functions to use if a app needs far east support?

it depends from which functions do you use. Can you show the code where you use TextOut and where you store lines in your array?
0
 
prefixAuthor Commented:
oh, It's hard to say, ok, leave your email, and I'll send my project to you, ok?
0
 
MichaelSCommented:
you can find my e-mail in my profile
0
 
prefixAuthor Commented:
Hi, MichaelS, did you received my mail? Can you solve the problem?
0
 
MichaelSCommented:
Hi, prefix, I have got your e-mail but wasn't able to open it correctly. Can you try it once more, I will reply on it and you will have my direct e-mail. You it.
0
 
prefixAuthor Commented:
Hi, the mail had been re-sent.
0
 
MichaelSCommented:
Ok, now I got it. I am trying to figure out how it works.
0
 
MichaelSCommented:
You just have problems with fonts. I tested your code, modifyed it and it works. I created in InitInstance global object of CFont and than before your ExtTextOut I selected it. Than I can see right japanece characters on the screen.

I think you even have to use ChoosFont function to allow user select his another font.
0
 
prefixAuthor Commented:
Hi, MichaelS, please send the modified code to me.
0
 
prefixAuthor Commented:
Hi, I received your code, but it the problem still haven't been solved.
And the cursor position is still wrong. And when I press backspace key, it deletes a half of a double-byte character.
My problem is not only displaying, this program has several problems on double-byte characters.
0
 
MichaelSCommented:
well, I afraid than just have no time to debug all your code and fix all the bugs, sorry.
0
 
prefixAuthor Commented:
ok, but can you tell me the way to modify my program supports dbs? How to store double-byte characters, how to prevent the separation of a double-byte characters, how to calcualte the right position of the cursor, and how let the system konw it is a double-byte-character compatible program?
Questions are too many, but I really no ideas of them. Thank you!
0
 
MichaelSCommented:
>Questions are too many, but I really no ideas of them.

Read a book about it. I ordered one from amazon when I was need this info, there is a compleat book also in MSDN. Look for "globalization" and "localization" of software.
0
 
prefixAuthor Commented:
MichaelS, if MSDN and the books which I found can help me enough, than I didn't need to ask this question here.
0
 
MichaelSCommented:
Ah, I see, you just need that someone correct your code, actually that someone 250 kb of your code.
0
 
prefixAuthor Commented:
No, Don't need to correct my code, but need tell me how to correct, not only tell me "there're some books about it, go and have some to read".
0
 
MichaelSCommented:
prefix, what was that?
0
 
prefixAuthor Commented:
Oh, sorry, I think you said it's about the problem of the font is right, but you didn't give me help enough(I think), I think still leaving the question is not a good idea.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 20
  • 18
Tackle projects and never again get stuck behind a technical roadblock.
Join Now