Technology Questions

Go Back   Technology Questions > Software Questions > Operating System Questions > Windows XP

Windows XP Discuss the Microsoft Windows XP Operating System



Reply
 
LinkBack Thread Tools
  #1  
Old 06-13-2009, 10:00 PM
Randem
Newsgroup Contributor
 
Posts: n/a
Is there a way to open a unicode file in Notepad with the correct script

I need to find a way to tell notepad to open a unicode japanese file and use
the japanese script so that the letters show correctly. Notepad cannot do
this own it's own.

--
Randem Systems
Your Installation Specialist
The Top Inno Setup Script Generator
http://www.randem.com/innoscript.html
Disk Read Error Press Ctl+Alt+Del to Restart
http://www.randem.com/discus/message...tml?1236319938




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

 
Old 06-13-2009, 10:00 PM
  #2  
Old 06-14-2009, 04:20 AM
Andrew McLaren
Newsgroup Contributor
 
Posts: n/a
Re: Is there a way to open a unicode file in Notepad with the correctscript

Randem wrote:
> I need to find a way to tell notepad to open a unicode japanese file and use
> the japanese script so that the letters show correctly. Notepad cannot do
> this own it's own.


Notepad uses a set of hueristics to determine whether a file is Unicode,
or some single-byte character set ... in other words, it tries to guess.

Canonically, Unicode files begin with the two byte "Byte-Ordering Mark",
0xFF 0xEF (or vice versoa for Little-Endian systems). Pretty well any
text file which begines with a BOM, will be opened by Notepad as Unicode.

After that, it may come down to Notepad's default font for Unicode
detection. On a English-language system, the default Notepad font
(Lucida Console?) does not contain the CJK range of Unicode chars. Try
setting the default font to a specifically Unicode font such as Arial
Unicode MS, or Lucida Sans Unicode, and try again. If glyphs for the
Unicode characters are present in the font set, then the is likely to
display correctly. If you open a file with Unicode chars which are not
in teh current font, then it cannot dispay correctly, whether it is
correctly detected as Unicode or not.

Hope it helps,

Andrew
--
amclar at optusnet dot com dot au
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #3  
Old 06-14-2009, 11:00 AM
Randem
Newsgroup Contributor
 
Posts: n/a
Re: Is there a way to open a unicode file in Notepad with the correct script

That I already knew... but the question remains...

--
Randem Systems
Your Installation Specialist
The Top Inno Setup Script Generator
http://www.randem.com/innoscript.html
Disk Read Error Press Ctl+Alt+Del to Restart
http://www.randem.com/discus/message...tml?1236319938



"Andrew McLaren" <me@somewhere.org> wrote in message
news:uMQn3nO7JHA.3304@TK2MSFTNGP06.phx.gbl...
> Randem wrote:
>> I need to find a way to tell notepad to open a unicode japanese file and
>> use the japanese script so that the letters show correctly. Notepad
>> cannot do this own it's own.

>
> Notepad uses a set of hueristics to determine whether a file is Unicode,
> or some single-byte character set ... in other words, it tries to guess.
>
> Canonically, Unicode files begin with the two byte "Byte-Ordering Mark",
> 0xFF 0xEF (or vice versoa for Little-Endian systems). Pretty well any text
> file which begines with a BOM, will be opened by Notepad as Unicode.
>
> After that, it may come down to Notepad's default font for Unicode
> detection. On a English-language system, the default Notepad font (Lucida
> Console?) does not contain the CJK range of Unicode chars. Try setting the
> default font to a specifically Unicode font such as Arial Unicode MS, or
> Lucida Sans Unicode, and try again. If glyphs for the Unicode characters
> are present in the font set, then the is likely to display correctly. If
> you open a file with Unicode chars which are not in teh current font, then
> it cannot dispay correctly, whether it is correctly detected as Unicode or
> not.
>
> Hope it helps,
>
> Andrew
> --
> amclar at optusnet dot com dot au



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #4  
Old 06-14-2009, 07:41 PM
Andrew McLaren
Newsgroup Contributor
 
Posts: n/a
Re: Is there a way to open a unicode file in Notepad with the correctscript

Randem wrote:
> That I already knew... but the question remains...


If "the question remains" then you probably haven't described your
question precisely enough. I'm not going to keep lobbing bits of
information at you, trying to guess what you already know, and what you
don't know.

But, for the record ...

To reduce it to a single API, Notepad on XP uses the Win32
IstextUnicode() API. As a professional developer, you'll be aware that
this API has a reputation for being a bit hit-and-miss. This has been
discussed extensively in Microsoft developer Blogs for several years;
such as:

"Some files come up strange in Notepad"
http://blogs.msdn.com/oldnewthing/ar.../24/95235.aspx

"The Notepad file encoding problem, redux"
http://blogs.msdn.com/oldnewthing/ar...7/2158334.aspx

and

"Why I don't like the IsTextUnicode API"
http://blogs.msdn.com/michkap/archiv...30/363308.aspx

"The Notepad encoding detection issues keep coming up"
http://blogs.msdn.com/michkap/archiv...2/2239345.aspx


You can read all about IstextUnicode() here:
http://msdn.microsoft.com/en-us/libr...72(VS.85).aspx

In Vista SP1 and later, Notepad uses it's own algorithms which are a bit
smarter than IstextUnicode(), to try to detect whether text is Unicode
or not. This reduces the frequency of mis-judgements, but it there is
still an element of chance and guessing.

If your question revolves around the interactive use of Notepad as an
end-user, then to open a file as Unicode is easy. Go to File menu, Open,
and select teh appropriate encoding from the drop down list in the File
Open dialogue: ANSI, Unicode, Unicode Big Endian, or UTF-8. Then select
the file you want to open. Again, CJK chars will only display correctly
if Notepad is using a font which contains the necessary CJK glyphs.

If this does not answer your question then please explain IN DETAIL what
you are trying to do, what the configuration is (eg what langugae
Windows are you using; do you have configured in Regional Settings etc)
and what results you are getting; preferably so we can reproduce and
debug the problem here.

Thanks

Andrew
--
amclar at optusnet dot com dot au
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #5  
Old 06-15-2009, 06:10 PM
Randem
Newsgroup Contributor
 
Posts: n/a
Re: Is there a way to open a unicode file in Notepad with the correct script

Sorry, it was basically a yes or no question. I just wanted to know if there
was a parameter you could supply that would tell Notepad what font script to
use with a partitcular file...

--
Randem Systems
Your Installation Specialist
The Top Inno Setup Script Generator
http://www.randem.com/innoscript.html
Disk Read Error Press Ctl+Alt+Del to Restart
http://www.randem.com/discus/message...tml?1236319938



"Andrew McLaren" <me@somewhere.org> wrote in message
news:%23Eo5MnW7JHA.5828@TK2MSFTNGP04.phx.gbl...
> Randem wrote:
>> That I already knew... but the question remains...

>
> If "the question remains" then you probably haven't described your
> question precisely enough. I'm not going to keep lobbing bits of
> information at you, trying to guess what you already know, and what you
> don't know.
>
> But, for the record ...
>
> To reduce it to a single API, Notepad on XP uses the Win32 IstextUnicode()
> API. As a professional developer, you'll be aware that this API has a
> reputation for being a bit hit-and-miss. This has been discussed
> extensively in Microsoft developer Blogs for several years; such as:
>
> "Some files come up strange in Notepad"
> http://blogs.msdn.com/oldnewthing/ar.../24/95235.aspx
>
> "The Notepad file encoding problem, redux"
> http://blogs.msdn.com/oldnewthing/ar...7/2158334.aspx
>
> and
>
> "Why I don't like the IsTextUnicode API"
> http://blogs.msdn.com/michkap/archiv...30/363308.aspx
>
> "The Notepad encoding detection issues keep coming up"
> http://blogs.msdn.com/michkap/archiv...2/2239345.aspx
>
>
> You can read all about IstextUnicode() here:
> http://msdn.microsoft.com/en-us/libr...72(VS.85).aspx
>
> In Vista SP1 and later, Notepad uses it's own algorithms which are a bit
> smarter than IstextUnicode(), to try to detect whether text is Unicode or
> not. This reduces the frequency of mis-judgements, but it there is still
> an element of chance and guessing.
>
> If your question revolves around the interactive use of Notepad as an
> end-user, then to open a file as Unicode is easy. Go to File menu, Open,
> and select teh appropriate encoding from the drop down list in the File
> Open dialogue: ANSI, Unicode, Unicode Big Endian, or UTF-8. Then select
> the file you want to open. Again, CJK chars will only display correctly if
> Notepad is using a font which contains the necessary CJK glyphs.
>
> If this does not answer your question then please explain IN DETAIL what
> you are trying to do, what the configuration is (eg what langugae Windows
> are you using; do you have configured in Regional Settings etc) and what
> results you are getting; preferably so we can reproduce and debug the
> problem here.
>
> Thanks
>
> Andrew
> --
> amclar at optusnet dot com dot au



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I open Notepad in Unicode mode? Pat Willener Windows XP 4 03-23-2009 02:33 PM
NOTEPAD and unicode William Windows XP 1 10-18-2007 04:00 AM
Entering Unicode Characters in Notepad Nathan Sokalski Windows XP 16 09-19-2007 12:59 AM
Entering Unicode Characters in Notepad Nathan Sokalski Windows XP 0 09-19-2007 12:53 AM
Entering Unicode Characters in Notepad Nathan Sokalski Windows XP 0 09-19-2007 12:53 AM


New To Technology Questions? Do You Need Help with Your Computer or Device? Do You Need Help with this site?

All times are GMT -8. The time now is 05:16 PM.


2003 - 2010 All Rights Reserved. Technology Questions

Search Engine Friendly URLs by vBSEO 3.3.0