3

I have an application that I have been testing for internationalization support.

There is, for example, a standard TEdit control, with the font.Name = 'Arial'.

On Windows 7, it seems to automatically grab the glyphs for CJK characters, from Arial Unicode MS, or somewhere else, for EDIT common controls, if the font that is assigned to that control, does not contain a certain international character.

On Windows XP, it seems that chinese characters show up as boxes, even when Arial Unicode MS font is installed, unless I change the Font name in the delphi form, to Arial Unicode MS.

Is this something that everybody encounters with international font support on windows XP? Do windows common controls behave differently? The behaviour I see on Windows 7 is certainly friendlier than the behaviour I see on Windows XP.

This behaviour difference is not constrained just to Windows Common Controls. It seems even Internet Explorer and the MS Explorer shell have problems doing tests like the picture here: enter image description here

  1. What do people do about this?

  2. What is the expected platform behaviour on Windows XP? Do you have to go find what language the user wants to use, and go find a font for them to to use, that supports that language? I guess Arial Unicode MS might be a good default, since it has almost every unicode language that there is.

Update: It looks like the Microsoft term "supplemental language support" refers to the "windows doesn't show my unicode characters as boxes" feature of Windows.

Warren P
  • 65,725
  • 40
  • 181
  • 316
  • It's the same in Windows Explorer. Boxes galore in XP, but peachy in Vista/7. – David Heffernan Mar 22 '11 at 18:01
  • It seems maybe, that more thought went into the Windows 7 internationalization experience? – Warren P Mar 22 '11 at 18:13
  • I know. But people might still expect your application to work nicely on it. Big corporate operations, might still be on XP, having only moved up last year from Windows 2000. – Warren P Mar 22 '11 at 18:38
  • @Warren It never ceases to amaze me what people expect of XP. It is utterly decrepit and should be put out to pasture. Who still runs Mac OS 9? – David Heffernan Mar 22 '11 at 18:41
  • 2
    I am merely a lowly professional software developer. When clients stop buying software, and stop demanding that it work on XP, I'll stop supporting it! :-) – Warren P Mar 22 '11 at 20:44
  • @Warren I know, same here. My customers still use it plenty. I just can't understand why! – David Heffernan Mar 22 '11 at 20:50
  • 2
    @David - because it works maybe? Your customers use software to do a job, not just for the sake of having the latest greatest bit of software to play with. Software Developers are a very limited subset of all computer users and it really does serve both that smaller subset and our ability to properly service the larger superset to remember that. If you don't understand why your customers are using some piece of software then you don't understand your customers well enough, imho. – Deltics Mar 22 '11 at 21:16
  • @Deltics You don't know our software. It wants multi-core machines which our clients buy and then cripple with 32 bit XP. Our software runs much better on 64 bit Vista/7. The reason they run XP is because IT forces them too. I freely admit to not understanding the reasoning behind many decisions made by my customers' IT departments. I'm not pro Vista/7 because it is new and shiny, it's because it is much much better than XP. I like to use high quality things that work and I find it hard to understand others who don't. – David Heffernan Mar 22 '11 at 21:19
  • @David: 32-bit has nothing what-so-ever to do with "crippling" multi-core machines (unless the IT dept insists on using XP Home Edition, which I doubt). If your software runs much better on 64-bit is that for any specific technical reason or simply an artefact of an implementation that has assumed a glut of resources? You're right, I don't know your software, but the conflation of "32-bit" and "multicore" suggest to me that the reasons in your mind aren't necessarily the reasons in reality. Just an observation. – Deltics Mar 22 '11 at 21:29
  • @Deltics I don't know why you cast judgement on my app without knowing it. 32 bit process get twice as much memory on 64 bit machines as they do on 32 bit machines. That's important in my app because it can quite happily max out 8 or 16 logical processors as found on modern machines. Each of these tasks wants memory to work better. Also 64 bit Vista/7 is more efficient at running multi-threaded code than 32 bit XP. – David Heffernan Mar 22 '11 at 21:34
  • @Deltics What's the comment about "assumed a glut of resources"? My clients love the fact that our software can make full use of the machines they have. They have large amounts of numerical analysis that they want to get done quickly. The fact that we can make their machines run 100% CPU is a plus point. Out competitors can't do that. Surely the idea is that software makes the most efficient use of the resources available to get the task done as quickly as possible? – David Heffernan Mar 22 '11 at 21:36
  • @David - I made no judgment about your app. 32-bitness restricts memory but has nothing to do with cores. Fact. Large amounts of analysis similarly doesn't necessarily require large amounts of memory. Analysis = Compute. Data = Storage. You are throwing lots of pseudo-technical information around but not connecting any of it in a meaningful way. All I am saying is that that itself could point to a misunderstanding on your part about just what exactly it is that is important to your app, not saying that I absolutely know any better, I just think you could know better yourself. Maybe? – Deltics Mar 23 '11 at 04:02
  • @David supplemental - I can write code that max's out 8, 16 or even 64 processors. Doesn't mean my app NEEDS to max out those processors. I can write code that demands 4TB of RAM. Doesn't mean it NEEDS 4TB of RAM. – Deltics Mar 23 '11 at 04:03
  • @Deltics It's really quite simple. My app peforms numerical time domain simulations of mechnical engineering problems. The simulations can take a long time, many hours, say. I presume you are capable of recognising that my users would want the simulations done as fast as possible. They get multi-core machines for that purpose. Having more memory results in faster simulations (memory is faster than disk as you know). Consequently 64 bit is beneficial, /LARGEADDRESSAWARE. More cores makes this more pronounced for obvious reasons. – David Heffernan Mar 23 '11 at 07:20
  • I hesitate to suggest that the ease with which XP activation can be bypassed might have anything to do with the incredible longevity of Windows XP. But perhaps people will still be using it for reasons that I can not fathom, even after those of us who upgrade, have gone on to Windows 11. ("Windows : These Go to Eleven!") – Warren P Mar 23 '11 at 13:33

1 Answers1

6

Vista and Windows 7 include support for East Asian languages out of the box. To enable it on Windows XP go into the Control Panel, open Regional and Language Options dialog, switch to the Languages tab, and check Install files for East Asian languages under Supplemental language support.

You can detect whether they've been installed using IsValidLanguageGroup by checking for one of the relevant languages with the LGRIP_INSTALLED flag:

uses
  Windows;

type
  LGRPID = DWORD;

const
  LGRPID_INSTALLED = $00000001;  // installed language group ids
  LGRPID_SUPPORTED = $00000002;  // supported language group ids

  LGRPID_WESTERN_EUROPE       = $0001; // Western Europe & U.S.
  LGRPID_CENTRAL_EUROPE       = $0002; // Central Europe
  LGRPID_BALTIC               = $0003; // Baltic
  LGRPID_GREEK                = $0004; // Greek
  LGRPID_CYRILLIC             = $0005; // Cyrillic
  LGRPID_TURKISH              = $0006; // Turkish
  LGRPID_JAPANESE             = $0007; // Japanese
  LGRPID_KOREAN               = $0008; // Korean
  LGRPID_TRADITIONAL_CHINESE  = $0009; // Traditional Chinese
  LGRPID_SIMPLIFIED_CHINESE   = $000a; // Simplified Chinese
  LGRPID_THAI                 = $000b; // Thai
  LGRPID_HEBREW               = $000c; // Hebrew
  LGRPID_ARABIC               = $000d; // Arabic
  LGRPID_VIETNAMESE           = $000e; // Vietnamese
  LGRPID_INDIC                = $000f; // Indic
  LGRPID_GEORGIAN             = $0010; // Georgian
  LGRPID_ARMENIAN             = $0011; // Armenian

function IsValidLanguageGroup(LanguageGroup: LGRPID; dwFlags: DWORD): BOOL; stdcall;
  external kernel32;

function IsCJKInstalled: Boolean;
begin    
  Result := IsValidLanguageGroup(LGRPID_SIMPLIFIED_CHINESE, LGRPID_INSTALLED);
end;
Zoë Peterson
  • 13,094
  • 2
  • 44
  • 64
  • 1
    +1 I think you can safely assume that any of your users who use such characters routinely will already have done this! – David Heffernan Mar 22 '11 at 18:48
  • I didn't know that those options enabled Font Linking – Warren P Mar 22 '11 at 20:44
  • Is there a way to detect if a particular XP system has font linking enabled? – Warren P Mar 22 '11 at 20:50
  • 2
    Well, looks like font linking is just one part of the technology known as supplemental language support. Here's specific code for detecting it: http://stackoverflow.com/questions/3434234/detect-if-any-right-to-left-language-is-installed/3434825#3434825 and a Microsoft guy actually recommending that approach: http://blogs.msdn.com/b/michkap/archive/2006/02/10/529867.aspx – Zoë Peterson Mar 22 '11 at 21:01
  • This answer is indeed correct I think, but I think the mention of "font linking" is unnecessarily technical and potentially confusing. The simple fact is surely that Windows 7 includes Asian Language support "out of the box" but that this has to be specifically enabled/installed on Windows XP (as per the "Language Support Options" described). – Deltics Mar 22 '11 at 21:21
  • @Deltics: I agree. I've redone the answer to get rid of that and added sample detection code (Delphi doesn't declare the necessary constants). – Zoë Peterson Mar 22 '11 at 22:46
  • I retagged the question. This is all about XP lacking out of box support for these languages, even though the FONT is installed, there is more to supporting it than that. This was the point I wasn't clear on. I thought, just install Arial Unicode MS, and go. Why should I have to go find my Windows XP install CD. But I do. Because there are core bits of Windows i18n missing until I do. – Warren P Mar 23 '11 at 13:30