help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Change encoding used to display strings? SOLVED


From: Steven Leffler
Subject: RE: Change encoding used to display strings? SOLVED
Date: Tue, 6 Apr 2010 10:04:46 -0400

Thanks. For anyone reading this in the list archives, the solution to my
problem was to add the following to my Octave program:

[Status, Text]=dos("chcp 1252")

As David suggested, the console running Octave was defaulting to code page
437 rather than the more modern 1252. 

The code page 65001, which gives Unicode UTF-8 support, does not appear to
work in Octave by the way, although it does work in the CMD shell.

-----Original Message-----
From: David Grundberg
Sent: Tuesday, April 06, 2010 7:43 AM

Steven Leffler wrote:
>
> I am having trouble figuring out how to change the encoding used to 
> display strings. I am using Octave 3.2.0 on Windows XP, and it seems 
> to use the antique US-DOS character encoding. I'm reading strings from 
> a file, which uses a different character encoding, and would like 
> these to be displayed correctly. How do I change the encoding Octave 
> uses to display strings? NB: this is not multibyte Unicode; the 
> encoding is 8-bit.
>
> For example in most modern 8-bit Western encodings, the degree symbol 
> is at 0xB0. Octave instead displays the DOS "light shade" graphical 
> character. How do I fix this?
>


Your win32 console is probably running Windows codepage CP850 or IBM-437 
and Octave is outputting in some other codepage. You can try changing 
the console to CP1251 (a bastard version of ISO-8859-1) or whatever your 
file is encoded in.

I don't run Windows, so I can't produce detailed instructions, but I 
found others with similar problems:

http://www.perlmonks.org/?node_id=329433

David



reply via email to

[Prev in Thread] Current Thread [Next in Thread]