Skip to content

change String::to_bytes() to String::encode() #2616

@bobzhang

Description

@bobzhang

The current String::to_bytes is misleading and confusing to AI given that MoonBit is utf16 encoded, we are gonna use x.encode(Utf8|Utf16le|Utf16be|Utfl16) instead 

I saw lots of code generated by AI which use .to_bytes in a wrong way
https://chatgpt.com/share/68b011a2-0308-8000-9544-10b586c22313

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions