in Education by
I just got Delphi 2009 and have previously read some articles about modifications that might be necessary because of the switch to Unicode strings. Mostly, it is mentioned that sizeof(char) is not guaranteed to be 1 anymore. But why would this be interesting regarding string manipulation? For example, if I use an AnsiString:='Test' and do the same with a String (which is unicode now), then I get Length() = 4 which is correct for both cases. Without having tested it, I'm sure all other string manipulation functions behave the same way and decide internally if the argument is a unicode string or anything else. Why would the actual size of a char be of interest for me if I do string manipulations? (Of course if I use strings as strings and not to store any other data) Thanks for any help! Holger JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
With Unicode SizeOf(SomeChar) <> Length(SomeChar). Essentially the length of a string is less then the sum of the size of its chars. As long as you don't assume SizeOf(Char) = 1, or SizeOf(SomeString[x]) = 1 (since both are FALSE now) or try to interchange bytes with chars, then you shouldn't have any trouble. Any place you are doing something creative stuffing Bytes into Chars or Strings, then you will need to use AnsiString. (SizeOf(SomeString) is still 4 no matter the length since it is essentially a pointer with some compiler magic.)

Related questions

0 votes
    I just got Delphi 2009 and have previously read some articles about modifications that might be necessary because ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 18, 2022 in Education by JackTerrance
0 votes
    I just got Delphi 2009 and have previously read some articles about modifications that might be necessary because ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    Relation dept year(dept name, total inst 2007, total inst 2008, total inst 2009). Here the only ... Answers, Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
0 votes
    Sorry for what may sound simple, but I am trying to draw just a simple box in Visual Studio 2017 using the unicode ... code below #include using namespace std; int main() { cout...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    I have several unicodes which show in mobile but not desktop. I'm assuming I can't force an @media ... : $ad_title $featureimg Contact Information . 📧 . 📞 📍....
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    I used the pyhton: for m in regex.findall(r"\X", 'ल्लील्ली', regex.UNICODE): for i in m: print(i, i.encode(' ... कृ','प','या','ल्ली' Select the correct answer from above options...
asked Jan 19, 2022 in Education by JackTerrance
0 votes
    Which of the following is not a valid encoding scheme for character?a. ASCII b. ISCII c. Unicode and. ASCII Select the correct answer from above options...
asked Dec 25, 2021 in Education by JackTerrance
0 votes
    Which of these occupy first 0 to 127 in Unicode character set used for characters in Java? (a) ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 28, 2021 in Education by JackTerrance
0 votes
    Which of the following function convert an integer to an unicode character in python? A - unichr(x) B - ord(x) C - hex(x) D - oct(x)...
asked Apr 10, 2021 in Education by JackTerrance
0 votes
    How will you convert an integer to an unicode character in python?...
asked Nov 24, 2020 in Technology by JackTerrance
0 votes
    It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
0 votes
    It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
0 votes
    Anyone know of an example of using Amazon SES with Delphi, or failing that, some tips to get me ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 4, 2022 in Education by JackTerrance
0 votes
    I've got a problem with exposing a DTO class through SOAP WebService. My class looks like TKontrahent = ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    I've got a problem with exposing a DTO class through SOAP WebService. My class looks like TKontrahent = ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 28, 2022 in Education by JackTerrance
...