File Exchange

image thumbnail

toHTML - convert Unicode string(s) to HTML

version 1.2.0.0 (2.59 KB) by Rody Oldenhuis
Convert a (cell) string to its Unicode representation in HTML.

1 Download

Updated 17 Aug 2015

GitHub view license on GitHub

TOHTML Converts strings to their UTF-8 HTML representation
str = TOHTML(str) converts the input string or cell array of strings to its Unicode representation in HTML. All characters but one: any occurrence of the newline character (char(10)) will be converted to the string '<br>'.
This function is most useful when creating buttons in a GUI, that need to contain a multi-line string with Unicode characters. For example:

EXAMPLE:

uicontrol(...
'style' , 'pushbutton',...
'units' , 'normalized',...
'string' , toHTML(['θ·Ω' char(10) 'A×B']),...
'position', [0.05 0.05 0.1 0.1]...
);

If you find this work useful, please consider a donation:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6G3S5UYM7HJ3N

Comments and Ratings (0)

Updates

1.2.0.0

[linked to Github]

1.1.0.0

Updated contact info

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux