Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pound and copyright symbols 1

Status
Not open for further replies.

Nigel Gomm

Programmer
Jan 10, 2001
423
CA
one PC (just one) with my VFP9 .exe installed is showing

� instead of a pound sign

and the unknown character symbol (diamond+?) instead of copyright.

These values aren't coming from a table but a hard coded character string.

The Windows regional settings are UK, no extra codepages or keyboards installed (that i can see) but i've just been told the PC came with German installed (but now uninstalled).

Anyone seen similar? I'm hoping not to have to tell the user to reinstall windows.

n

 
What does the string actually contain? And how did you create the string?

If you typed a pound sign on your UK keyboard, that should be stored as CHR(163). Is that what you are seeing? The same would apply if you typed ALT+156. If you typed ALT+163, you would get a lower-case u with an acute accent.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
the copyright symbol appears in a VFP form's label. The pound sign in a textbox (but disappears because of the way i change the .inputmask property in the .when() event.)

So i can't easily get the actual values. But the copyright symbol is hard coded with

thisform.lblCopyright.CAPTION = "© Nigel Gomm 1995 - "+STR(YEAR(DATE()),4)+" All Rights Reserved."


i overrode the set sysformat with a set currency and am waiting to hear if that fixed that at least.

i'll try and gain access to the PC in question and experiment in the command window.

n



 
[tt]SET CURRENCY[/tt] shouldn't affect values stored within strings. It mainly only affects currency data types, or conversions such as with [tt]TRANSFORM(lnAmount, "@$")[/tt].

Your caption code looks exactly right to me. The only thing I can think of off-hand is to check that the target font actually contains a pound symbol (in the expected position). If the label has some unusual font, just try setting it to Arial as a test.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
i should stress this same .exe is installed on about 3 or 4 thousand PCs around the country. Just this one PC playing up.

with the pound sign it was in currency conversions such as transform, inputmask or printed in reports that the problem was showing.

hmmm.... the font is 'Segoe UI'. i'll make sure it's installed.

n
 
Of course, you could get at the ASC values of the displayed character with ASC(left(this.caption,1)) and similar.

You can also find out what codepages are assigned to each of your project files via:
Code:
For each loFile in _vfp.ActiveProject.Files
   ? loFile.codepage, loFile.name
endfor

But when the binary EXE is the same this won't differ unless you only think it is the same EXE from the same build. The only things that remain are ANSI code page used by the system or font anomalies, missing fonts leading to the OS using a replacement font.

I can just assure you, that a German Windows (10) a) uses the Latin1 ANSI codepage 1252 and b) both copyright and pound characters are present and are the byte codes 163 for the pound symbol and 169 for the copyright symbol.

Windows has overrides for non-Unicode applications as VFP executables are. So it may still pay to look into the Windows system regional settings in detail.

And otherwise, fonts, as already suggested by yourself and Mike. I see Segoe UI is a standard Windows font replacing Tahoma, but if this is XP that's not the case. Segoe was introduced in Vista and I'm not finding whether that already was Segoe UI or just Segoe.

What you show here rather looks like a misconverted UTF-8 character, though, which actually is not converted, but stayed in the 2 bytes the character is in UTF-8. And � actually are the bytes that make up a � character in UTF-8, so it looks like some character encoding conversion failed and from that sometimes the Unicode character is displayed as-is: �. And sometimes it's displayed as its two bytes and their two ANSI characters �. Are you using Webbrowser control or any Unicode capable controls like RTF control?

If you don't do any string conversion calls like STRCONV() the only way I know you can step on your own foot nowadays is via this beta feature option of Windows 10:
systemlocaleutf8_kiq2ob.png


Bye, Olaf.

Olaf Doschke Software Engineering
 
good shout Olaf.

in language settings, administrative language settings, change system locale

you can get that region settings dialog back and unset the 'beta' checkbox.

and now all is well.

thanks

n
 
I had experimented with this, but the whole thing then will depend on the user also having that setting.
You don't naturally get some characters typed in anymore, so you'd need some keyboard mapping within the IDE and more.
And in beta status you still never know whether the workarounds you find out will finally work.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top