Welcome, Guest
Username: Password: Remember me
General Purpose Components and Libraries, discussions, problems and suggestions
  • Page:
  • 1

TOPIC:

HOT*** Problem with encoding of letters :( 9 years 3 weeks ago #6963

  • Tigr
  • Tigr's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 54
  • Thank you received: 1
Recently decided to write a server on Typhone and faced the problem of character encodings, and it was Cyrillic.... one gets the feeling that it is non-existent)
As an example: by pressing the Memo we awake to display the index and the symbol!

Test#1....
for i:=1 to 1300 do
memo1.Lines.add(inttostr(i)+' '+chr(i));

Specify in advance:
CharSet the Memo is Default_charSet

Result: No Russian characters!((((

Test#2....
Here we are dealing directly remove it from the symbol of his room table!:
s:=edit1.Text;
edit2.Text:=inttostr(ord(s[1]));

Latin things very well, but with the Cyrillic alphabet have the same problem its "almost there," but she is still there as it is not strange!
The RESULT:))) For the entire alphabet, the program gives us only two reserved Cyrillic value is 208 and 209 - 't that weird?)

Test#3 .....
Now let's make it what would we introduced the symbol itself converted:
s:=edit1.Text;
edit1.Text:=chr(ord(s[1]));

What is most fun is that we get an empty result, or rather nothing! (((

In delphi xe6 at the same parameters Memo Russian characters are there(see the picture)!
Now the question!?: How to find them in Typhone?
Attachments:

Please Log in or Create an account to join the conversation.

HOT*** Problem with encoding of letters :( 9 years 3 weeks ago #6966

  • Tigr
  • Tigr's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 54
  • Thank you received: 1
Problem solved!
Cyrillic UTF-8 is 2 bytes, that would work with it gently to check a string for the value of the first byte, if it still wakes 208 or 209, the second byte wakes equal to the character code from the table!
For example, the character code "A" wakes equal (208176) and on this basis it is possible to work with them! is as a simple example of
s:=chr(208)+chr(176);
// s=>"A"

Please Log in or Create an account to join the conversation.

HOT*** Problem with encoding of letters :( 9 years 3 weeks ago #6967

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4508
  • Thank you received: 1100
Thanks Sir
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

  • Page:
  • 1