#1 2020-09-04 09:00:15

radexpol
Member
From: Poland, Krk
Registered: 2019-11-29
Posts: 116

String vs RawUTF8 conversion hints

Whole mORMot framework works with RawUTF8 which is an AnsiString containing UTF8 characters. How to deal with string conversion working with standard Delphi components based on string type. I'm getting nervous seeing hundreds of hints concerning string conversion, for example:

button1.Caption := DateTimeMSToString(Now)
W1057 Implicit string cast from 'RawUTF8' to 'string'

What is the best solution to get rid those hints?

Offline

#2 2020-09-04 09:39:03

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,673
Website

Re: String vs RawUTF8 conversion hints

Read https://synopse.info/files/html/Synopse … ml#TITL_32

In short: UTF8ToString() / StringToUTF8() or explicit string() / RawUTF8() transtyping.

Offline

Board footer

Powered by FluxBB