Command Window + utf-8

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Command Window + utf-8

Octave - General mailing list
Hi,

Does Octave Command Window (CW) support utf-8?
I want to properly output some data (mini report) in CW.
Now (v6.2.0) such code

disp ('Ašies plotas, mm²')

outputs as follows:

A�?ies plotas, mm?�

Dainius

Reply | Threaded
Open this post in threaded view
|

Re: Command Window + utf-8

mmuetzel
Am 25. Februar 2021 um 09:31 Uhr schrieb "Dainius V. via Help-octave":

> Hi,
>
> Does Octave Command Window (CW) support utf-8?
> I want to properly output some data (mini report) in CW.
> Now (v6.2.0) such code
>
> disp ('Ašies plotas, mm²')
>
> outputs as follows:
>
> A�?ies plotas, mm?�
>
> Dainius

Which OS do you use?

Markus



Reply | Threaded
Open this post in threaded view
|

Re: Command Window + utf-8

mmuetzel
Am 25. Februar 2021 um 16:04 Uhr schrieb "Dainius V.":
> > Which OS do you use?
>
> Win10 Enterprise.

Please, keep the mailing list in CC.

It works for me with Windows 10 Pro 20H2 and Octave 6.2.0 using the GUI.

What do you see for the following commands in Octave?
__mfile_encoding__
__locale_charset__

Markus



Reply | Threaded
Open this post in threaded view
|

Re: Command Window + utf-8

Octave - General mailing list
In reply to this post by Octave - General mailing list
> What do you see for the following commands in Octave?
> __mfile_encoding__
> __locale_charset__

Octave CW:
>> __mfile_encoding__
ans = utf-8
>> __locale_charset__
ans = CP1257

If I understand correctly, it is wrong with __locale_charset__ value. How to change it?

Dainius
 
----- Reply to message -----
Subject: Re: Command Window + utf-8
Date: kt, 25 vas. 2021, 17:19
From: Markus Mützel [hidden email]
To: Dainius V. [hidden email]
Am 25. Februar 2021 um 16:04 Uhr schrieb "Dainius V.":
> > Which OS do you use?
>
> Win10 Enterprise.

Please, keep the mailing list in CC.

It works for me with Windows 10 Pro 20H2 and Octave 6.2.0 using the GUI.

What do you see for the following commands in Octave?
__mfile_encoding__
__locale_charset__

Markus
 


Reply | Threaded
Open this post in threaded view
|

Re: Command Window + utf-8

mmuetzel
Am 25. Februar 2021 um 21:57 Uhr schrieb "Dainius V.":

> > What do you see for the following commands in Octave?
> > __mfile_encoding__
> > __locale_charset__
>
> Octave CW:
> >> __mfile_encoding__
> ans = utf-8
> >> __locale_charset__
> ans = CP1257
>
> If I understand correctly, it is wrong with __locale_charset__ value. How to change it?

That looks good to me.
Are you sure the file you are testing with is actually encoded in UTF-8?
Could you please attach the file that produces the wrong output for you?

Markus



Reply | Threaded
Open this post in threaded view
|

Re: Command Window + utf-8

Octave - General mailing list
Attached a file and an image of the Octave environment


 
----- Reply to message -----
Subject: Re: Command Window + utf-8
Date: pn, 26 vas. 2021, 14:17
From: Markus Mützel [hidden email]
To: Dainius V. [hidden email]
Am 25. Februar 2021 um 21:57 Uhr schrieb "Dainius V.":
> > What do you see for the following commands in Octave?
> > __mfile_encoding__
> > __locale_charset__
>
> Octave CW:
> >> __mfile_encoding__
> ans = utf-8
> >> __locale_charset__
> ans = CP1257
>
> If I understand correctly, it is wrong with __locale_charset__ value. How to change it?

That looks good to me.
Are you sure the file you are testing with is actually encoded in UTF-8?
Could you please attach the file that produces the wrong output for you?

Markus
 



skerspjuvio_rod.m (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Command Window + utf-8

mmuetzel
Am 26. Februar 2021 um 15:37 Uhr schrieb "Dainius V.":
> Attached a file and an image of the Octave environment

The file looks good to me. And the characters are correctly displayed for me.

The Command Window on Windows uses the Windows console. Could you please check that the option for the legacy console is de-activated on your system?
You can find that option in the properties dialog of the Windows command prompt.
Run "cmd.exe", click on the icon in the title bar of the command prompt and select "Properties". Make sure the option for the legacy console is un-checked.
I'll attach a screen shot of that dialog. But it is in German. I hope that at least the layout will be similar across different locales.
You might have to reboot Windows after changing that setting.

Does that make any difference?

Markus



command_window_legacy.png (32K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Command Window + utf-8

mmuetzel
Am 26. Februar 2021 um 16:16 Uhr schrieb "Dainius V.":
> A big THANK YOU - it worked.

Keep the mailing list in CC when answering.
It might be very important for someone coming across this in the future with a similar problem to know if this was resolved or reached a dead end.

Glad I could help.

Markus