File: test_matlab_style_utf8.m

package info (click to toggle)
octave-doctest 0.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 524 kB
  • sloc: makefile: 103; xml: 26
file content (23 lines) | stat: -rw-r--r-- 565 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function s = test_matlab_style_utf8()
% Test function with some non-ASCII characters in UTF-8
%
% This file is encoded in UTF-8.  Here is the euro symbol:
% >> s = '€';
% >> disp(s)
% €
% >> disp(test_matlab_style_utf8())
% €
%
%
% Its not our business how this is storied internally (its utf-8
% on Octave, not sure on Matlab).  But we can convert explicitly
% to utf-8:
% >> nums = unicode2native(s, 'utf-8');
% >> double(nums)
%        226   130   172

% Copyright (c) 2022-2023 Colin B. Macdonald
% SPDX-License-Identifier: BSD-3-Clause

  s = '€';
end