Forum > Beginners

how evaluate TEncoding for string argument?

(1/1)

alexraynepe196:
Hallow!
have a `function(var x: string)`.
need TEncoding for x, how to evaluate it? Is there alredy universal method somwhere?
i not see in TEncoding constructor like TEncoding( const  String)

af0815:
See https://forum.lazarus.freepascal.org/index.php?topic=45307.0 maybe it nearly the same question about detecting encoding.

Remy Lebeau:

--- Quote from: alexraynepe196 on November 14, 2021, 08:01:11 pm ---have a `function(var x: string)`.
need TEncoding for x, how to evaluate it?

--- End quote ---

Not really sure what you are asking for.

Are you asking how to determine the charset which 'x' is encoded in, and then get a TEncoding for that charset?

Or, are you asking how to use the value of 'x' as a charset name to get a TEncoding for that charset?


--- Quote from: alexraynepe196 on November 14, 2021, 08:01:11 pm ---i not see in TEncoding constructor like TEncoding( const  String)

--- End quote ---

Look at TEncoding.GetEncoding(const EncodingName: UnicodeString).

Navigation

[0] Message Index

Go to full version