0

I downloaded a Matlab code sample online and the comments are showing as strange characters. as shown below

% Ïðîãðàììà ïîèñêà íîìåðîâ àâòîìîáèëåé è ðàñïîçíàâàíèÿ 
% áóêâ è öèôð íîìåðà ïðè èñïîëüçîâàíèè íåéðîííûõ ñåòåé
% Íîìåð îòîáðàæàåòñÿ ïîñëå ãîëîñîâàíèÿ

function Detection_Recognition1()
clear
clc

% Îòêðûòèå ôàéëà
video=mmreader('car10.avi'); % 2 4 5 6" 7 8 9 10 11 12

% Íåêîòîðûå ñâîéñòâà âèäåî
width=video.Width;                   % Øèðèíà êàäðà
height=video.Height;                 % Âûñîòà êàäðà
frameRate=video.FrameRate;           % Ñêîðîñòü êàäðîâ â ñåê.
numOfFrames=video.NumberOfFrames;    % Êîëè÷åñòâî êàäðîâ â âèäåî ôàéëå

% ×òåíèå äèàïàçîíà êàäðîâ (íóìåðóþòñÿ ñ 1)
Range=[1 numOfFrames];               % Äèàïàçîí êàäðîâ
frames=read(video,Range);
sizFrames=size(frames);

I tried opening it on Windows and Linux too and the same jibberish comes out. What could cause this and how can it be converted to ASCII?

Recap
  • 168
  • 2
  • 15
  • 1
    I assume it's some foreign character set, Arabic, Hebrew or similar. Could you put the link here or the file on Dropbox or similar so we can access the original? – Daniel Dec 02 '15 at 20:43
  • @Daniel https://www.dropbox.com/sh/fc9xmvexm5b2dlh/AAA7p6bKTQFSsJVehWtfKwWKa?dl=0 That is the Dropbox link. The code is for vehicle number plat recognition – Recap Dec 02 '15 at 20:46
  • In my honest opinion, this could be Chinese comments. – LaPriWa Dec 02 '15 at 20:46
  • 1
    It's probably Chinese encoding (GB or BIG5). You can ignore it... – zeeMonkeez Dec 02 '15 at 20:46
  • @zeeMonkeez How can i convert it or even open it with Chinese encoding? – Recap Dec 02 '15 at 20:49
  • @Recap I copied it into [this conversion tool](http://www.mdbg.net/chindict/chindict.php), using GB or BIG5 as original encoding (and ISO as current). While I don't read Chinese, BIG5 looks more plausible. You could try to paste the output into Google translate. – zeeMonkeez Dec 02 '15 at 20:51
  • @zeeMonkeez I don't see how this tool can convert anything. It is just a Chinese translator – Recap Dec 02 '15 at 20:56
  • The following things must be in place for MATLAB to display chinese unicode text: 1. The language preferences for your operating system must be properly set. 2. The character set must be supported by MATLAB. (eg. Big5 encoding) 3. The custom font preferences for the Editor and Command windows in MATLAB must be set to monospaced, plain. Go to File->Preferences->Fonts->Custom. Select 'Editor' or 'Command Window' from the text box and change the font preferences. – LaPriWa Dec 02 '15 at 20:58

1 Answers1

2

Matlab encodes source files always in the operating system default character set, in this case it was Cyrillic(Windows).

If you speak russian or whatever language it is and intend to read the comments, you may write a small script based on this to change the encoding to unicode. Same is possible using batch

Community
  • 1
  • 1
Daniel
  • 36,610
  • 3
  • 36
  • 69
  • 2
    Thanks a million Daniel. I got it working now and the language is Russian which is also perfect since I can read a little in Russian. Once again, thanks. – Recap Dec 02 '15 at 21:04