Author Topic: Special characters show on different PCs  (Read 6348 times)

0 Members and 1 Guest are viewing this topic.

MeasureUp

  • Bull Frog
  • Posts: 465
Special characters show on different PCs
« on: March 27, 2013, 07:27:53 PM »
By using "Notepad++", I noticed that I get different result when type special characters on different pcs.
For example, if I use "ALT + 241" I get ± (plus and minus) on work pc while I get ) on my laptop.
How to get the same ± on the laptop?

System:
Work PC: Win7 Pro
Laptop: Win7 HP

Thanks for your help.

Lee Mac

  • Seagull
  • Posts: 12922
  • London, England
Re: Special characters show on different PCs
« Reply #1 on: March 27, 2013, 07:51:45 PM »
Try ALT+0177
The difference may be caused by your system code page; or maybe you missed the '2' since ALT+41 will generate ")".
« Last Edit: March 27, 2013, 08:01:06 PM by Lee Mac »

MeasureUp

  • Bull Frog
  • Posts: 465
Re: Special characters show on different PCs
« Reply #2 on: March 27, 2013, 08:02:23 PM »
Thanks Lee.
I confuse with this. How can I fix this on the laptop (HP)?
The work PC is Dell.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Special characters show on different PCs
« Reply #3 on: March 28, 2013, 12:01:57 AM »
It might be a setting in windows called the locale code-page. To see what it is, start a command console and type the chcp command.

By default the en-us would give you something like this:
Code: [Select]
C:\>chcp
Active code page: 437

Check if these differ on the 2 machines. If so change to the one which you prefer by typing the correct code after chcp.

Note this could change special keys on your laptop, so I'd not just change this willy nilly.

Something like:
Code: [Select]
C:\>chcp 437
Active code page: 437

As Lee's pointed out, try learning the unicode keystrokes instead. It's only one extra digit, but you'd not need to change stuff on the machine.

Edit: Official MS code pages - http://msdn.microsoft.com/en-us/goglobal/bb964655
« Last Edit: March 28, 2013, 12:10:30 AM by irneb »
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

MeasureUp

  • Bull Frog
  • Posts: 465
Re: Special characters show on different PCs
« Reply #4 on: March 28, 2013, 12:40:49 AM »
It might be a setting in windows called the locale code-page. To see what it is, start a command console and type the chcp command.

By default the en-us would give you something like this:
Code: [Select]
C:\>chcp
Active code page: 437

Check if these differ on the 2 machines. If so change to the one which you prefer by typing the correct code after chcp.

Note this could change special keys on your laptop, so I'd not just change this willy nilly.

Something like:
Code: [Select]
C:\>chcp 437
Active code page: 437

As Lee's pointed out, try learning the unicode keystrokes instead. It's only one extra digit, but you'd not need to change stuff on the machine.

Edit: Official MS code pages - http://msdn.microsoft.com/en-us/goglobal/bb964655
Thanks irneb.
I changed "chcp" value to 850 on laptop to match the one on work pc.
But "ALT + 241" doesn't return ±.
And when I restart the laptop the "chcp" value changes back to what it was but "850".

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Special characters show on different PCs
« Reply #5 on: March 28, 2013, 01:56:30 AM »
Then it seems your laptop has some other issue.

It's really strange. Check in Control Panel -> Region and Language. On both the "Keyboards and Languages" and the "Administrative" tabs, check what's the settings there. Perhaps your laptop's got a special purpose keyboard setting.

Anyhow, you know the Alt+241 keystroke is officially discontinued? It's only working because of old DOS compatibility. Actually it's been deprecated since Windows 95 (nearly 20 years), but is still working only because MS didn't (yet) remove the old code from their libraries. So I'd advise learning the "new" codes to be on the safe side.

As a sample, open both the Character Map and the Calculator. In CM choose a font like Arial, then at the bottom enable Advanced view and select a Character set like "DOS United States" (this is that 437 code page). Pick the ± character and look at the status bar, it should show something like:
Code: [Select]
U+00B1 (0xF1): Plus-Minus Sign                          Keystroke: Alt+0177
Change your Calculator to the programmer type (View -> Programmer). Pick the Hex option and type in the Hex code listed. In this case U+00B1 is the unicode ... click the Dec mode to translate to Decimal ... the number becomes 177. The code-page hex of F1 becomes the old 241.

Next repeat the process using the "Windows: Western". This is the same as the old Latin 1 codepage (840), referred to as Windows-1252. And is usually the default used in windows ... the only place where you're supposed to be able to use the old DOS codes is inside the CMD window. The ± character status bar now lists:
Code: [Select]
U+00B1 (0xF1): Plus-Minus Sign                          Keystroke: Alt+0177Notice it's still the same for that particular character? That's why I said it sounds strange.

But I would definitely start learning the unicode keystrokes instead. Makes it possible to get those special characters no matter what the settings are. Easiest is the Alt0### as these use decimal number, but to get to even more complex characters you might want to go with the Alt+XXXX where XXXX is the Hex code, (though you need some registry hack to enable this).
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Lee Mac

  • Seagull
  • Posts: 12922
  • London, England
Re: Special characters show on different PCs
« Reply #6 on: March 28, 2013, 09:19:10 AM »
Very thorough explanation Irné  :-)

FWIW, I use Wolfram Alpha when looking up characters (and for pretty much everything else...)

Jürg Menzi

  • Swamp Rat
  • Posts: 599
  • Oberegg, Switzerland
Re: Special characters show on different PCs
« Reply #7 on: March 28, 2013, 12:47:43 PM »
Numeric key block available on Laptop?

Cheers
A computer's human touch is its unscrupulousness!
MENZI ENGINEERING GmbH
Current A2k16... A2k24 - Start R2.18

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Special characters show on different PCs
« Reply #8 on: March 28, 2013, 02:53:12 PM »
Very thorough explanation Irné  :)

FWIW, I use Wolfram Alpha when looking up characters (and for pretty much everything else...)
Thanks! Unfortunately my internet connection isn't too great, so I can't always use online tools.  :realmad: But thanks for that link! It does seem to lay out the answer nicely in clearly understandable descriptions. Obviously it's more than just a character lookup site  ;)

If I'm really stuck with trying to find the character in that huge list of unicodes, I either use Charmap's unicode subranges, or the search box if I know something of the char's name, or if pushed: http://unicodelookup.com/#plus/1

Numeric key block available on Laptop?
Also the right-Alt key sometimes has different functionality (sometimes marked on the keyboard as "Alt Gr". Try using the left Alt key to see if it does something different.

And another thing: On my HP Pavilion dv6 some of my keys default to the special purpose. E.g. all the function keys at the top needs the Fn key held down to actually perform their F1-F12 functions, else they're stuff like screen brightness +/-, sound volume +/-, etc. There's probably a setting somewhere to turn that off as well, though even with it on the Left-Alt + 241 gives me the ± (as long as NumLock is on), but the Right-Alt does all sorts of strange behaviours (e.g. it seemed to initiate this page's "Go Back" function).
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Lee Mac

  • Seagull
  • Posts: 12922
  • London, England
Re: Special characters show on different PCs
« Reply #9 on: March 28, 2013, 03:30:00 PM »
You're welcome Irné!

Obviously it's more than just a character lookup site ;)

Much, much more  :wink:

And another thing: On my HP Pavilion dv6 some of my keys default to the special purpose. E.g. all the function keys at the top needs the Fn key held down to actually perform their F1-F12 functions, else they're stuff like screen brightness +/-, sound volume +/-, etc. There's probably a setting somewhere to turn that off as well, though even with it on the Left-Alt + 241 gives me the ± (as long as NumLock is on), but the Right-Alt does all sorts of strange behaviours (e.g. it seemed to initiate this page's "Go Back" function).

I believe you can turn off the 'Fn lock' from the BIOS to reverse that behaviour, see here:-)

MeasureUp

  • Bull Frog
  • Posts: 465
Re: Special characters show on different PCs
« Reply #10 on: April 01, 2013, 08:43:48 PM »
Thanks again.
The problem is that the IT guys lock my work pc and I can't do any changes to code page or keyboard settings.
On the other hand, I have checked the keyboard settings on my laptop again. Those settings are what I want to keep.

As the result, it looks likely it can't be solved.

I also googled and found there are 2 sets of ALT codes. For example, for the "±" symbol:
1) ALT 241
Link: http://tools.oratory.com/altcodes.html
2) ALT 177
Link: http://www.netlingo.com/more/specialcharacters.php#definition

My work pc works for the 1st set while my laptop works for 2nd set.
The next quetion is:
Would the special characters created by work pc display correctly on my laptop?
If not, must I rewrite the special characters in the routines by using the 2nd set of ALT code on the laptop?

Thanks in advance.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Special characters show on different PCs
« Reply #11 on: April 02, 2013, 01:07:49 AM »
If you're referring to ACad's DWG files, then there shouldn't be a problem after you've added the character into a text object. Seeing as ACad saves to UTF8 codes (since 2007) these are common no matter what the setting. Previously there might have been issues depending on the code page.
 
If you mean the LSP needs to set the ± into a piece of text, that might also work regardless of code page, but I'm not too sure - since LSP is usually saved to the current ANSI code page. I'd advise using the "\U+####" unicode method of adding such characters into your lisp. That way there can be not issue about characters going wrong because of some setting somewhere.
 
E.g.:
Code - Auto/Visual Lisp: [Select]
  1. (entmod (subst '(1 . "New \U+00B1 character") (assoc 1 edata) edata))
Whould change the text to display:
Quote
New ± character
No matter what code page is in use.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

MeasureUp

  • Bull Frog
  • Posts: 465
Re: Special characters show on different PCs
« Reply #12 on: April 02, 2013, 02:22:52 AM »
If you're referring to ACad's DWG files, then there shouldn't be a problem after you've added the character into a text object. Seeing as ACad saves to UTF8 codes (since 2007) these are common no matter what the setting. Previously there might have been issues depending on the code page.
 
If you mean the LSP needs to set the ± into a piece of text, that might also work regardless of code page, but I'm not too sure - since LSP is usually saved to the current ANSI code page. I'd advise using the "\U+####" unicode method of adding such characters into your lisp. That way there can be not issue about characters going wrong because of some setting somewhere.
 
E.g.:
Code - Auto/Visual Lisp: [Select]
  1. (entmod (subst '(1 . "New \U+00B1 character") (assoc 1 edata) edata))
Whould change the text to display:
Quote
New ± character
No matter what code page is in use.
Thanks irneb.
I was lazy to learn the unicode.  :wink:
This is a nice link but I'd like to use it off-line when the internet connection is not available.
Is there a complete chart which can be downloaded?

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Special characters show on different PCs
« Reply #13 on: April 02, 2013, 04:56:14 AM »
Is there a complete chart which can be downloaded?
Well, you could save the wikipedia page as PDF (see the options in the sidebar: Print/Export --> download as PDF): http://en.wikipedia.org/wiki/List_of_Unicode_characters

Or you could download specific subsections of the UniCode tables in PDF from here: http://www.unicode.org/charts/
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

MeasureUp

  • Bull Frog
  • Posts: 465
Re: Special characters show on different PCs
« Reply #14 on: April 02, 2013, 07:16:27 PM »
Is there a complete chart which can be downloaded?
Well, you could save the wikipedia page as PDF (see the options in the sidebar: Print/Export --> download as PDF): http://en.wikipedia.org/wiki/List_of_Unicode_characters

Or you could download specific subsections of the UniCode tables in PDF from here: http://www.unicode.org/charts/
Thanks irneb.
It looks great. I don't mind if I have to download the charts individually.
The other thing is that I can't see what exact symbol is in the Notepad by using unicode method.  :|