Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Feb 2007
    Location
    London
    Posts
    225
    Thanks
    16
    Thanked 2 Times in 2 Posts

    Special characters and Notepad2

    If I click 'view source' from:
    http://en.wikipedia.org/wiki/Interna...netic_Alphabet
    and copy some particularly obscure special characters (extended IPA) from the notepad file that shows me the source, then paste them into a Notepad2 file, I sometimes get the dreaded 'square', and sometimes see the character properly.

    Note that the encoding of the Notepad2 file is UTF-8 before I paste the characters.

    Moreover, even when the 'squares' are shown in the file, Firefox correctly displays the special characters after uploading the file.

    Please could someone shed some light on this strange behaviour for me? :-)

    My goal is to type IPA into the Notepad2 file (i.e. for the symbols to be visible, without the need for typing char refs and other hard-to-proofread nonsense).

    Perhaps my problem is that I need a different text editor, though I can't think why Notepad2 shouldn't handle this correctly...

    Thanks a lot.

  • #2
    Senior Coder twodayslate's Avatar
    Join Date
    Mar 2007
    Location
    VA
    Posts
    1,042
    Thanks
    67
    Thanked 39 Times in 39 Posts
    So when you copy and paste these codes you get the square?
    twitter | Quality Hosting - $5.95/mo*
    Feel free to PM me!

  • #3
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,302
    Thanks
    28
    Thanked 276 Times in 270 Posts
    Quote Originally Posted by cfructose View Post
    Please could someone shed some light on this strange behaviour for me?
    You may need to configure your editor to use a font that contains the relevant characters. DejaVu Sans Mono is a free font that contains glyphs for the IPA character block in case you don’t have one.

    Firefox will substitute glyphs from other fonts when a font doesn’t contain a needed glyph, hence why you will always see them display properly as long as a font is installed on the OS that contains the character; I don’t know of any text editors with that capability.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #4
    Regular Coder
    Join Date
    Feb 2007
    Location
    London
    Posts
    225
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Twodayslate - all the symbols on the page you referenced appear perfectly in the notepad2 file.

    Arbitrator - I don't know which font Notepad2 is using (nor is it possible to change it), but it clearly contains all the glyphs I need as even e̝ ('e raised')and chinese characters appear correctly. (In short, all unicode).

    The strange thing is that there seems to be no way to input them by typing...I can only copy and paste from other sources. Plus, even when they appear on the notepad file, they suddenly metamorphose into squares when I try to edit them.

    Argh!

    So, are there no text editors with full unicode support?

  • #5
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,302
    Thanks
    28
    Thanked 276 Times in 270 Posts
    Quote Originally Posted by cfructose View Post
    Arbitrator - I don't know which font Notepad2 is using (nor is it possible to change it), but it clearly contains all the glyphs I need as even e̝ ('e raised')and chinese characters appear correctly. (In short, all unicode).
    Well, in Notepad++ I can get Japanese characters to display for a font that lacks glyphs for them, but characters from the IPA and symbols blocks show up with the replacement character glyph (the square). I would guess that it has language switching support rather than real glyph substitution capability. The same may be true for your Notepad2 program.

    Quote Originally Posted by cfructose View Post
    The strange thing is that there seems to be no way to input them by typing...I can only copy and paste from other sources. Plus, even when they appear on the notepad file, they suddenly metamorphose into squares when I try to edit them.
    The same thing happens when I use Notepad++. When I try to enter the character directly (holding Alt and pressing “+266e”) I get a question mark (which is rendered literally as just that in the browser). When I copy and paste I get a square (yet it’s rendered correctly in the browser).

    Anyway, I would change your editor’s font to something like DejaVu Sans Mono or another font that supports the IPA block. If Notepad2 can’t change fonts, it would seem to be more primitive than Microsoft Notepad in that regard. Try another editor like jEdit. Notepad++ is also an option, however, it won’t allow me to select the DejaVu Sans Mono font for some reason (I can select DejaVu Sans Mono Bold Oblique though, oddly enough).
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #6
    Regular Coder
    Join Date
    Feb 2007
    Location
    London
    Posts
    225
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Arbitrator,

    Thanks for all that info. Very useful! :-)
    I'll check out jEdit, and will bear everything you said in mind.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •