-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwriteUchr.m
More file actions
29 lines (23 loc) · 714 Bytes
/
writeUchr.m
File metadata and controls
29 lines (23 loc) · 714 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function writeUchr(FILE_IN,FILE_OUT,KeyToCharTable,KeyOutput)
%
%
%
% Commit changes back to UCHR file
%
%
%
% FILE_OUT = 'RussianPhonetic2.uchr';
% Create a copy of an input file
copyfile(FILE_IN,FILE_OUT);
% Open copied file and start patching with new Unicode codes
fid = fopen(FILE_OUT,'r+');
if fid<0,
error('Could not open output UCHR file.');
end
for itable=1:length(KeyToCharTable.keyToCharTableOffsets),
% KeyOutputT(itable) =
% readStuct(FILE_IN,UCKeyOutput,KeyToCharTable.keyToCharTableOffsets(itable));
fseek(fid,KeyToCharTable.keyToCharTableOffsets(itable),'bof');
fwrite(fid,KeyOutput(itable).UCKeyOutput,class(KeyOutput(itable).UCKeyOutput));
end
fclose(fid);