Skip to content

Modern Fs Stream WriteUtf8

Paul Squires edited this page Oct 22, 2026 · 3 revisions

Home › Filesystem › File Streams › Stream.WriteUtf8

Stream.WriteUtf8

Writes a string as UTF-8, with no BOM.

Syntax

Stream.WriteUtf8( s )

Notes

  • Writes s as UTF-8 with no BOM -- the encoding WriteAllText uses. A lone surrogate is written as U+FFFD.

Examples

#import "std/fs"
using fs

dim as MemoryStream m
m.WriteUtf8( "na" & wchr( &hEF ) & "ve" )
print m.Length( )    '' 6 -- the i with diaeresis is two bytes

Library: Filesystem Library Category: File Streams Documented under: Streams

Clone this wiki locally