Accents lost in .Alldata transfer

Home Forums kbmMW Accents lost in .Alldata transfer

Viewing 3 reply threads
  • Author
    Posts
    • #54400
      zoran
      Participant

      Hi Kim

      I have table with string field containing characters with accents. When I run query from the client I get everything ok. If I call a service, read same data and return .AllData to the client, some of the accented letters loose accent. For example Š, Đ are returned as expected, but Č and Ć are both returned as letter C.

      On the server side I’m using all default settings in kbmMWFireDACQuery and kbmMWBinaryStreamFormat.

      Code is simple:

      kbmMWFireDACQuery1.Query.Text := ‘select …’;
      kbmMWFireDACQuery1.Open;
      result := kbmMWFireDACQuery1.AllData;

      Is there something I should set differently?

      Thank you for your time.

      Zoran

    • #54401
      kimbomadsen
      Keymaster

      Hi,

      That sounds odd. Can you provide me with the smallest possible sample app with source, showing the problem so I can investigate.

      Under the hood, strings are written using TWriter.WriteString and read using TReader.ReadString which conditionally either writes the data as ASCII, UTF8 or 2 byte unicode (UTF-16/UCS-2).
      UTF-16 actually do not support the complete unicode character set, why that could be the side effect seen?

    • #54402
      zoran
      Participant

      Hi Kim

      In my client I had:

      qry.AllData := v;

      When I add in front of it

      kbmMWBinaryStreamFormat1.PrepareForData(False, False);

      all works fine.

      Thank you.

    • #54405
      zoran
      Participant

      After some more testing I found out that PrepareForData can be replaced with qry.Open.

      Some accents are lost with this code:

      qry.Close;

      //qry.Open;

      qry.AllData := v;

      but if I uncomment the second line, all works fine.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.