Javier Enciso wrote:
>  Have you tried setting the default code page (810?) to 65001?

Thanks, Javier, for your answer ! So I made further investigations, and here
are my findings.

Using special non 7-bits special characters with Octave 3.2.x MinGW Windows,
we must distinguish 2 cases : (A) interactive (commands passed from the
Octave command window), and (B) from m-files (scripts or functions). Here
are my experiments on Windows XP SP3 French (where the default Windows
code-page is 850 = Multilingual Latin-1 = Western European) :

A) INTERACTIVELY : to be able to enter, from the Octave window (keyboard),
non 7-bits special european characters (like àéèâôï..., to define or display
strings...), I've found that the *only* Windows code-page working is 437
(others like 850=ISO-Latin and 65001=UTF-8 are not working). So the user
*need* to change the code-page, from the Octave windows or .octaverc, with
the command: dos('chcp 437'). But this is the old DOS/OEM character set
(http://en.wikipedia.org/wiki/Code_page_437) and not the Western European
ISO-Latin (code-page 850), and if the user writes these strings to files
(with fprintf(file,'%s \n',string) ) they are encoded in this old IBM/PC
DOS/OEM character set  :-(

B) FROM M-FILES : it depends, of course, on the script/function encoding :

- script ANSI-encoded : it's *impossible* to dispay correctly special
  non-7bits characters from the script to the Octave window (whatever
  the code-page) :-( If these strings are written to text-files, they
  will be of course ISO-latin-1 encoded.
  
- script UTF-8-encoded (without BOM) : the script displays correctly
  special non-7bits characters to the Octave window, but to work
  the code-page *must* be UTF-8 (defined by: dos('chcp 65001') )
  *and* the Octave window *must* be based (through the Octave
  shortcut) on a TrueType font (like "Lucida Console") and *not*
  on a raster font ! If these strings are written to text-files,
  they will be of course UTF-8 encoded.
  
- script DOS/OEM-encoded : the script displays correctly special
  non-7bits characters to the Octave window (whatever the code-page
  and the font used). But if these strings are written to files,
  they will be IMB/PC DOS/OEM encoded :-(


Conclusion : there is actually no ideal setting with Octave 3.2.x MinGW,
because :

- to be able to work INTERACTIVELY with special characters, we need
  to use old 437 code-page, but UTF-8 encoded scripts will then not
  dispay correctly special characters

- to manipulate special characters from M-FILES, they can't be ANSI
  (ISO-latin-1) encoded ; they must be UTF-8 encoded (or DOS/OEM
  encoded, but it's an old proprietary coding standard)


I remember that the situation was not so bad with Octave 3.0.3 MSVC++ 

JDB
-- 
View this message in context: 
http://old.nabble.com/Unable-to-display-special-characters-with-accents-tp29641626p29702618.html
Sent from the octave-dev mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to