How to call ExtractFilePath function to get UnicodeString result? [Solved] lazarus / 21-General ---------------------------------------------------------------------- Vodnik · 2024-01-22 19:25 Function ExtractFilePath is documented (https://lazarus- ccr.sourceforge.io/docs/rtl/sysutils/extractfilepath.html) having two variants: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function ExtractFilePath(const FileName: UNICODESTRING):UNICODESTRING;and Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function ExtractFilePath(const FileName: RAWBYTESTRING):RAWBYTESTRING;By default it returns result as RawByteString. What should I do to get result as UnicodeString? ---------------------------------------------------------------------- dsiders · 2024-01-22 19:44 Quote from: Vodnik on January 22, 2024, 08:25:13 pmFunction ExtractFilePath is documented (https://lazarus- ccr.sourceforge.io/docs/rtl/sysutils/extractfilepath.html) having two variants: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function ExtractFilePath(const FileName: UNICODESTRING):UNICODESTRING;and Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function ExtractFilePath(const FileName: RAWBYTESTRING):RAWBYTESTRING;By default it returns result as RawByteString. What should I do to get result as UnicodeString? If you want UnicodeString in the return value, then the FileName argument has to be UnicodeString too. ---------------------------------------------------------------------- KodeZwerg · 2024-01-22 19:45 Quote from: Vodnik on January 22, 2024, 08:25:13 pmWhat should I do to get result as UnicodeString?By doing as it ask, assign and feed it with a unicode string. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var  us: UnicodeString;begin  us := 'some unicode';  us := ExtractFilePath(us); ---------------------------------------------------------------------- Vodnik · 2024-01-23 06:49 Thanks! Easy, indeed.