Home   Archive   Permalink



Saving a file with utf-8 encoding from withing a Rebol 2 script

Hi!
    
I am using a REBOL/view script to automate the construction of webpages. In my html code headers I define the meta charset to utf-8. However, texts that include accented vowels or the Ñ or ñ character (the n tilde entity) do not come out right, which would be expected if the file that defines the completed html code was not itself saved with utf-8 encoding.
    
To be fair, this can be circumvented if one sets the meta charset to ISO-8859-1
    
But I would like to know if it is possible to use save, load or some refinement of them to create the file with utf-8 encoding (with or without BOM) from within a Rebol script.
    
Thanks for your help

posted by:   Brother Damian     31-Mar-2016/21:46:43-7:00



Yes it is possible to save UTF-8 from Rebol but you need to convert the text first yourself.
    
These utility functions may help - http://www.rebol.org/view-script.r?script=str-enc-utils.r

posted by:   Peter Wood     1-Apr-2016/7:36:15-7:00