Recent

Author Topic: how evaluate TEncoding for string argument?  (Read 1368 times)

alexraynepe196

  • New Member
  • *
  • Posts: 26
how evaluate TEncoding for string argument?
« on: November 14, 2021, 08:01:11 pm »
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

  • Hero Member
  • *****
  • Posts: 1289
Re: how evaluate TEncoding for string argument?
« Reply #1 on: November 14, 2021, 08:08:18 pm »
See https://forum.lazarus.freepascal.org/index.php?topic=45307.0 maybe it nearly the same question about detecting encoding.
regards
Andreas

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 1312
    • Lebeau Software
Re: how evaluate TEncoding for string argument?
« Reply #2 on: November 15, 2021, 07:07:23 pm »
have a `function(var x: string)`.
need TEncoding for x, how to evaluate it?

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?

i not see in TEncoding constructor like TEncoding( const  String)

Look at TEncoding.GetEncoding(const EncodingName: UnicodeString).
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

 

TinyPortal © 2005-2018