Author | Topic: Box characters | |
---|---|---|
Frankie | Box characters on Sat, 29 Dec 2007 21:05:21 +0800 Hi all, I have converted a clipper app to xbase hybrid version using XbpCrt and everything works fine so far. Then recently i need to switch my XP Regional Languages to 'Chinese (PRC)' and i realised that the @...BOX "Box String" command does not display the proper box characters anymore. Swtiching back to Regional Languages 'English' allow the app to display proper box characters. SO, how to display the right box characters in 'Chinese' as the regional languages ? TIA Frankie | |
Frankie | Re: Box characters on Sat, 29 Dec 2007 21:09:18 +0800 Actually the original clipper app also does not display the right box characters in 'Chinese' as Regional Languages. Maybe there is not work around for it? TIA Frankie | |
Rodd Graham | Re: Box characters on Sun, 30 Dec 2007 04:09:01 +0000 Hello Frankie, > Actually the original clipper app also does not display the right box > characters in 'Chinese' as Regional Languages. > > Maybe there is not work around for it? You might try setting the font to the OEM codepage on the XbpCrt():setFont(). See the documentation on this method. I think you set the codepage on the font, then set the font on the xbpCRT. You will need to use a font that includes the OEM codebase such as AlaskaCRT. Since Chinese is not listed as a supported :codePage, I am unsure what Xbase++ is doing. Here are some insightful links that might help: http://groups.google.com/group/microsoft.public.win32.programmer.international/browse_thread/thread/36a29d92e47e3cee http://www.sisulizer.com/support/codepages.shtml Ultimately, you will need to use a font and codepage combination that has the box characters according to the OEM character coding. Note: It does look like you can set the non-unicode application code page on the advanced tab of the regional settings. Not sure if Xbase++ respects this or drives the code pages directly to the Win32 GDI. Note: I only work in English and have not needed tested any of this. Regards, Rodd Graham, Consultant Graham Automation Systems, LLC | |
Frans Vermeulen | Re: Box characters on Sun, 30 Dec 2007 10:18:31 +0100 Rodd, > Since Chinese is not listed as a supported :codePage, I am unsure what Xbase++ > is doing. The box characters are defined in "box.ch" In Clipper that meaned the characters were defined as a string litteral. In Xbase++ they are defined as nationmsg's (basically the same strings) Frankie has to fiddle a bit around and try, what strings give what results. It might be not possible to get a complete set in some regional settings. I'm not sure whether or not ansi-oem conversions are spitting in the soup, but that problem could also be solved by fiddling with the below mentioned defines. Regards, Frans Vermeulen #define B_SINGLE "ABCDEFGH" #define B_DOUBLE "IJKLMNOP" #define B_SINGLE_DOUBLE "QRSTUVWX" #define B_DOUBLE_SINGLE "abcdefgh" #define B_THIN "ijklmnop" #define B_FAT "qrstuvwx" | |
Rodd Graham | Re: Box characters on Mon, 31 Dec 2007 08:21:42 +0000 Hello Frans, >> Since Chinese is not listed as a supported :codePage, I am unsure >> what Xbase++ is doing. >> > The box characters are defined in "box.ch" > In Clipper that meaned the characters were > defined as a string litteral. Curiously, the comments in my "box.ch" state that codepage 437 must be used for the box characters to display correctly. Regards, Rodd Graham, Consultant Graham Automation Systems, LLC | |
AUGE_OHR | Re: Box characters on Sun, 30 Dec 2007 16:42:15 +0100 hi, > Then recently i need to switch my XP Regional Languages to 'Chinese (PRC)' > and i realised that the @...BOX "Box String" command does not display the > proper box characters anymore. #IFDEF __XPP__ b_type0 := CHR( 201 ) + CHR( 205 ) + CHR( 187 ) + CHR( 186 ) + CHR( 188 ) + CHR( 205 ) + CHR( 200 ) + CHR( 186 ) + " " b_type1 := CHR( 218 ) + CHR( 196 ) + CHR( 191 ) + CHR( 179 ) + CHR( 217 ) + CHR( 196 ) + CHR( 192 ) + CHR( 179 ) + " " b_type2 := CHR( 218 ) + CHR( 196 ) + CHR( 191 ) + CHR( 179 ) + CHR( 217 ) + CHR( 196 ) + CHR( 192 ) + CHR( 179 ) b_type3 := CHR( 218 ) + CHR( 196 ) + CHR( 191 ) + CHR( 179 ) + CHR( 217 ) + CHR( 196 ) + CHR( 192 ) + CHR( 179 ) + " " #ELSE b_type0 = "ͻȺ " b_type1 = "Ŀ " b_type2 = "Ŀ" b_type3 = "Ŀ" #ENDIF try one of the b_type as BOX. if you need only a part of the BOX try this : FUNCTION NAT_LINE( nNo ) "Ŀ" - "ͻȺ " LOCAL aLINE := {} LOCAL Retvar := "" LOCAL i DEFAULT nNo TO 0 IF nNo = 0 AADD( aLINE, "" ) nNo := 1 ELSEIF nNo > 8 FOR i = 1 TO 8 AADD( aLINE, SUBSTR( b_type0, i, 1 ) ) "ͻȺ " NEXT nNo := nNo - 8 ELSE FOR i = 1 TO 8 AADD( aLINE, SUBSTR( b_type2, i, 1 ) ) "Ŀ" NEXT ENDIF Retvar := aLINE[ nNo ] RETURN Retvar greetings by OHR Jimmy | |
Frankie | Re: Box characters on Mon, 31 Dec 2007 13:29:38 +0800 On Sat, 29 Dec 2007 21:05:21 +0800, Frankie wrote: Hi All, I have tried all the define setting and XbpCrt setfont things but it doesn't work. Finally i set the Language for non-Unicode programs in the advanced tab of Regional and Languages Options back to English and the box comes back again. As i check further about the box chr, it was form by the 8 ascii box graphics. From the web info about Unicode, ascii & ansi, i think my Hybrid app was affected by the Language for non-Unicode programs being set to Chinese. As 1 chinese chr was form by 2 bytes, and there are thousand of chinese words, the graphics box maybe wasnt defined or push to some other place, i guess. Well, i dont want to waste too much time on this issue. Just to educate my client to not use other language for the non-unicode program except English. Thanks again for all of your helps. Frankie |