Typing mathematical unicode characters on Windows 7

"Please leave a message at the beep, we will get back to you when your support contract expires."

Moderators: phlip, Prelates, Moderators General

Typing mathematical unicode characters on Windows 7

Postby Eebster the Great » Mon Mar 26, 2012 6:50 pm UTC

I have been looking for ways to input unicode characters directly from the keyboard in Windows 7, and found some stuff about EnableHexNumpad. With this, I can type all characters up to U0FFFF with Alt + [Plus], then the code , but I can't seem to type anything U10000 or beyond. I'm particularly interested in the mathematical characters on that plane. Is there no way to enter these directly, so I have to find them and copypaste?
User avatar
Eebster the Great
 
Posts: 1706
Joined: Mon Nov 10, 2008 12:58 am UTC

Re: Typing mathematical unicode characters on Windows 7

Postby eligitine » Mon Mar 26, 2012 10:05 pm UTC

I edit an unreasonable amount of times.
User avatar
eligitine
 
Posts: 28
Joined: Wed Mar 21, 2012 3:12 pm UTC

Re: Typing mathematical unicode characters on Windows 7

Postby Eebster the Great » Mon Mar 26, 2012 11:00 pm UTC

The tool seems to be working, except when I enter characters, it doesn't print the right one. I get two squares instead of math bold, for instance. But when I copy and paste the relevant characters, they show up properly.
User avatar
Eebster the Great
 
Posts: 1706
Joined: Mon Nov 10, 2008 12:58 am UTC

Re: Typing mathematical unicode characters on Windows 7

Postby eligitine » Tue Mar 27, 2012 2:32 pm UTC

For me, that usually has to do with fonts. Most fonts can't handle the higher Unicode characters.
I edit an unreasonable amount of times.
User avatar
eligitine
 
Posts: 28
Joined: Wed Mar 21, 2012 3:12 pm UTC

Re: Typing mathematical unicode characters on Windows 7

Postby Eebster the Great » Tue Mar 27, 2012 3:52 pm UTC

eligitine wrote:For me, that usually has to do with fonts. Most fonts can't handle the higher Unicode characters.

Right, but what I mean is, I can display characters like 𝐀𝐁𝐂𝐃𝐄𝐅𝐆𝐇𝐈𝐉𝐊𝐋𝐌𝐍𝐎𝐏𝐐𝐑𝐒𝐓𝐔𝐕𝐖𝐗𝐘𝐙𝐚𝐛𝐜𝐝𝐞𝐟𝐠𝐡𝐢𝐣𝐤𝐥𝐦𝐧𝐨𝐩𝐪𝐫𝐬𝐭𝐮𝐯𝐰𝐱𝐲𝐳𝟎𝟏𝟐𝟑𝟒𝟓𝟔𝟕𝟖𝟗, but I can't enter them in any way I have yet found. I can't enter them with alt +, I can't enter them with the tool posted, and I can't even find them on charmap. All I can do is copy and paste. It's very frustrating.
User avatar
Eebster the Great
 
Posts: 1706
Joined: Mon Nov 10, 2008 12:58 am UTC

Re: Typing mathematical unicode characters on Windows 7

Postby EvanED » Tue Mar 27, 2012 5:07 pm UTC

Someone should port SCIM to Windows. That lets you enter Unicode characters with tex macros (where there's overlap).
EvanED
 
Posts: 4122
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Re: Typing mathematical unicode characters on Windows 7

Postby Xanthir » Tue Mar 27, 2012 8:56 pm UTC

Eebster the Great wrote:The tool seems to be working, except when I enter characters, it doesn't print the right one. I get two squares instead of math bold, for instance. But when I copy and paste the relevant characters, they show up properly.

This implies that someone in the chain between the input method and whatever you're pasting into doesn't understand the astral planes, assumes that those characters (which are almost certainly encoded in UTF-16 using surrogates, as that's what most OSes use) are invalid, and replaces them with the replacement character U+FFFD.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))
User avatar
Xanthir
My HERO!!!
 
Posts: 4305
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex

Re: Typing mathematical unicode characters on Windows 7

Postby Eebster the Great » Wed Mar 28, 2012 12:15 am UTC

Xanthir wrote:
Eebster the Great wrote:The tool seems to be working, except when I enter characters, it doesn't print the right one. I get two squares instead of math bold, for instance. But when I copy and paste the relevant characters, they show up properly.

This implies that someone in the chain between the input method and whatever you're pasting into doesn't understand the astral planes, assumes that those characters (which are almost certainly encoded in UTF-16 using surrogates, as that's what most OSes use) are invalid, and replaces them with the replacement character U+FFFD.

Yeah, that's definitely what's happening, since the problem only exists with characters beyond the BMP. Do you have any idea how to resolve this, or is it probably overly complicated? It's not in any sense a big deal, just annoying.
User avatar
Eebster the Great
 
Posts: 1706
Joined: Mon Nov 10, 2008 12:58 am UTC

Re: Typing mathematical unicode characters on Windows 7

Postby eligitine » Wed Mar 28, 2012 3:11 pm UTC

I was reading up, and it appears that with most major browers, it works correctly (if you have a font that supports it), but if you type it on a page that is is using a charset that doesn't support it, it will not be transmitted to the website correctly.
I edit an unreasonable amount of times.
User avatar
eligitine
 
Posts: 28
Joined: Wed Mar 21, 2012 3:12 pm UTC

Re: Typing mathematical unicode characters on Windows 7

Postby Eebster the Great » Wed Mar 28, 2012 3:28 pm UTC

eligitine wrote:I was reading up, and it appears that with most major browers, it works correctly (if you have a font that supports it), but if you type it on a page that is is using a charset that doesn't support it, it will not be transmitted to the website correctly.

I'm typing it into Notepad though.
User avatar
Eebster the Great
 
Posts: 1706
Joined: Mon Nov 10, 2008 12:58 am UTC

Re: Typing mathematical unicode characters on Windows 7

Postby eligitine » Wed Mar 28, 2012 3:39 pm UTC

Notepad supports very little unicode with its loaded fonts.
I edit an unreasonable amount of times.
User avatar
eligitine
 
Posts: 28
Joined: Wed Mar 21, 2012 3:12 pm UTC

Re: Typing mathematical unicode characters on Windows 7

Postby Eebster the Great » Wed Mar 28, 2012 3:47 pm UTC

eligitine wrote:Notepad supports very little unicode with its loaded fonts.

But it clearly supports these characters in that font, like I said before, it's just entering them that's the issue. I think it's a system problem, not an application one.
User avatar
Eebster the Great
 
Posts: 1706
Joined: Mon Nov 10, 2008 12:58 am UTC

Re: Typing mathematical unicode characters on Windows 7

Postby eligitine » Wed Mar 28, 2012 3:52 pm UTC

It supports the character, but in a different font. Notepad has a hard time switching automatically, you need to switch to a font that supports the character before entering it in. When you paste it, it pastes it in the right font.
I edit an unreasonable amount of times.
User avatar
eligitine
 
Posts: 28
Joined: Wed Mar 21, 2012 3:12 pm UTC

Re: Typing mathematical unicode characters on Windows 7

Postby Eebster the Great » Wed Mar 28, 2012 4:38 pm UTC

Notepad++ isn't any better. Do you have a recommendation?
User avatar
Eebster the Great
 
Posts: 1706
Joined: Mon Nov 10, 2008 12:58 am UTC

Re: Typing mathematical unicode characters on Windows 7

Postby eligitine » Thu Mar 29, 2012 2:36 pm UTC

I would use wordpad. Its not the best option, but it has a better time switching between fonts. The only problem is you have to press Alt-X after typing some hex digits to get it to work.
I edit an unreasonable amount of times.
User avatar
eligitine
 
Posts: 28
Joined: Wed Mar 21, 2012 3:12 pm UTC

Re: Typing mathematical unicode characters on Windows 7

Postby Eebster the Great » Thu Mar 29, 2012 6:22 pm UTC

Wordpad gives me ASCII characters instead of the proper ones.

I think I'm going to sort of give up on this, since even if there is a solution it's unlikely to be very easy.
User avatar
Eebster the Great
 
Posts: 1706
Joined: Mon Nov 10, 2008 12:58 am UTC

Re: Typing mathematical unicode characters on Windows 7

Postby hotaru » Thu Mar 29, 2012 8:48 pm UTC

babelpad should work...
Code: Select all
uint8_t f(uint8_t n)
{ if (!(
n&1)) return 2;
  if (
n==169) return 13; if (n==121||n==143) return 11;
  if (
n==77||n==91) return 7; if (n==3||n==5) return 0;
  
n=(n>>4)+(n&0xF); n+=n>>4n&=0xF;
  return (
n==3||n==6||n==9||n==12||n==15)?3:(n==5||n==10)?5:0; } 
User avatar
hotaru
 
Posts: 949
Joined: Fri Apr 13, 2007 6:54 pm UTC

Re: Typing mathematical unicode characters on Windows 7

Postby Xanthir » Thu Mar 29, 2012 9:30 pm UTC

I prefer the simplest text editor: data:text/html;charset=utf-8,<pre contenteditable>. Just paste that into the address bar, and you get all the goodness of browsers handling unicode pretty well.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))
User avatar
Xanthir
My HERO!!!
 
Posts: 4305
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex

Re: Typing mathematical unicode characters on Windows 7

Postby EvanED » Thu Mar 29, 2012 10:12 pm UTC

Xanthir wrote:I prefer the simplest text editor: data:text/html;charset=utf-8,<pre contenteditable>. Just paste that into the address bar, and you get all the goodness of browsers handling unicode pretty well.

That's hilarious, but everyone knows that the simplest text editor is cat.

(I actually make files with cat... one of my friends says I'm sick in the head.)
EvanED
 
Posts: 4122
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Re: Typing mathematical unicode characters on Windows 7

Postby hotaru » Fri Mar 30, 2012 1:58 am UTC

EvanED wrote:That's hilarious, but everyone knows that the simplest text editor is cat.

no, it isn't. echo is simpler.
Code: Select all
uint8_t f(uint8_t n)
{ if (!(
n&1)) return 2;
  if (
n==169) return 13; if (n==121||n==143) return 11;
  if (
n==77||n==91) return 7; if (n==3||n==5) return 0;
  
n=(n>>4)+(n&0xF); n+=n>>4n&=0xF;
  return (
n==3||n==6||n==9||n==12||n==15)?3:(n==5||n==10)?5:0; } 
User avatar
hotaru
 
Posts: 949
Joined: Fri Apr 13, 2007 6:54 pm UTC

Re: Typing mathematical unicode characters on Windows 7

Postby Eebster the Great » Fri Mar 30, 2012 2:08 am UTC

Xanthir wrote:I prefer the simplest text editor: data:text/html;charset=utf-8,<pre contenteditable>. Just paste that into the address bar, and you get all the goodness of browsers handling unicode pretty well.

I don't get it.
User avatar
Eebster the Great
 
Posts: 1706
Joined: Mon Nov 10, 2008 12:58 am UTC

Re: Typing mathematical unicode characters on Windows 7

Postby Xanthir » Fri Mar 30, 2012 6:49 pm UTC

Eebster the Great wrote:
Xanthir wrote:I prefer the simplest text editor: data:text/html;charset=utf-8,<pre contenteditable>. Just paste that into the address bar, and you get all the goodness of browsers handling unicode pretty well.

I don't get it.

If you need a simple text editor that can handle unicode properly, take the above data: url and paste it into your browser's address bar. It won't work in older IE, but every other browser understands data urls. (Depending on your browser's default styles, you may have to click up at the top to get a cursor initially, because the <pre> is only 1 line tall.)

I *think* I'm the first person to have used this method in public to generate a text-editor on the fly, and made it semi-popular by using it in several talks when I suddenly needed some way to type out some example code.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))
User avatar
Xanthir
My HERO!!!
 
Posts: 4305
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex

Re: Typing mathematical unicode characters on Windows 7

Postby Jplus » Fri Mar 30, 2012 10:21 pm UTC

Wait. Are there more html tags to which one may add the contenteditable property?
Feel free to call me Julian. J+ is just an abbreviation.
Image coding and xkcd combined
User avatar
Jplus
 
Posts: 1543
Joined: Wed Apr 21, 2010 12:29 pm UTC
Location: classified

Re: Typing mathematical unicode characters on Windows 7

Postby hotaru » Fri Mar 30, 2012 10:44 pm UTC

Jplus wrote:Wait. Are there more html tags to which one may add the contenteditable property?

http://www.w3schools.com/html5/html5_ref_globalattributes.asp wrote:The global attributes below can be used on any HTML5 element.
Code: Select all
uint8_t f(uint8_t n)
{ if (!(
n&1)) return 2;
  if (
n==169) return 13; if (n==121||n==143) return 11;
  if (
n==77||n==91) return 7; if (n==3||n==5) return 0;
  
n=(n>>4)+(n&0xF); n+=n>>4n&=0xF;
  return (
n==3||n==6||n==9||n==12||n==15)?3:(n==5||n==10)?5:0; } 
User avatar
hotaru
 
Posts: 949
Joined: Fri Apr 13, 2007 6:54 pm UTC

Re: Typing mathematical unicode characters on Windows 7

Postby Eebster the Great » Sat Mar 31, 2012 2:16 pm UTC

That tag doesn't do anything but generate a blank page on my Firefox 11. I can't click anywhere or type anything.
User avatar
Eebster the Great
 
Posts: 1706
Joined: Mon Nov 10, 2008 12:58 am UTC

Re: Typing mathematical unicode characters on Windows 7

Postby phlip » Mon Apr 02, 2012 4:18 am UTC

Try giving it some starting text, like:
data:text/html,<pre contenteditable>click here

Incidentally, I use data URIs all the time to get unicode text... I'll often go to data:text/html,&ndash; or data:text/html,&%23x1234; or something, and copy/paste the resulting character...
While no one overhear you quickly tell me not cow cow.
but how about watch phone?
User avatar
phlip
Restorer of Worlds
 
Posts: 7162
Joined: Sat Sep 23, 2006 3:56 am UTC
Location: Australia

Re: Typing mathematical unicode characters on Windows 7

Postby Eebster the Great » Mon Apr 02, 2012 3:32 pm UTC

phlip wrote:Try giving it some starting text, like:
data:text/html,<pre contenteditable>click here

Ah, that works. I still can't type characters beyond the BMP though. BUT:

Incidentally, I use data URIs all the time to get unicode text... I'll often go to data:text/html,&ndash; or data:text/html,&%23x1234; or something, and copy/paste the resulting character...

This seems to work. For instance, data:text/html,&%23x1D400 gives 𝐀. Cool stuff.

Thanks
User avatar
Eebster the Great
 
Posts: 1706
Joined: Mon Nov 10, 2008 12:58 am UTC


Return to The Help Desk

Who is online

Users browsing this forum: No registered users and 2 guests