Git Product home page Git Product logo

Comments (6)

mgatny avatar mgatny commented on June 27, 2024

Are you using an older version of qf/n?

I think we very explicity transmit in iso-8859-1 (latin1) which is the protocol standard:

~/dev/quickfixn/QuickFIXn$ cat CharEncoding.cs; grep -A5 " Send(" SocketReader.cs SocketInitiatorThread.cs 
namespace QuickFix
{
    public static class CharEncoding
    {
        public static System.Text.Encoding DefaultEncoding;

        static CharEncoding()
        {
            DefaultEncoding = System.Text.Encoding.GetEncoding("iso-8859-1");
        }
    }
}
SocketReader.cs:        public int Send(string data)
SocketReader.cs-        {
SocketReader.cs-            byte[] rawData = CharEncoding.DefaultEncoding.GetBytes(data);
SocketReader.cs-            stream_.Write(rawData, 0, rawData.Length);
SocketReader.cs-            return rawData.Length;
SocketReader.cs-        }
--
SocketInitiatorThread.cs:        public bool Send(string data)
SocketInitiatorThread.cs-        {
SocketInitiatorThread.cs-            byte[] rawData = CharEncoding.DefaultEncoding.GetBytes(data);
SocketInitiatorThread.cs-            stream_.Write(rawData, 0, rawData.Length);
SocketInitiatorThread.cs-            return true;
SocketInitiatorThread.cs-        }

from quickfixn.

githubniko avatar githubniko commented on June 27, 2024

I want the encoding to be taken out to the settings. This will make quick fix more flexible.

"ISO-8859-1" is a standard for English-speaking people. My broker uses win1251 by default and I get a crooked text display and then I have to recode the iso-8859-1 - >win1251, which consumes computing resources.

Now I have edited win1251 encoding in the Char Encoding.cs file and everything has worked for me. Example:

public static class CharEncoding
    {
        public static System.Text.Encoding Default Encoding;

        static Char Encoding()
        {
            ////Default Encoding = System.Text.Encoding.GetEncoding("iso-8859-1");
            Default Encoding = System.Text.Encoding.GetEncoding(1251);
        }
    }

image

  1. Default Encoding = System.Text.Encoding.GetEncoding("iso-8859-1");
  2. (right) Default Encoding = System.Text.Encoding.GetEncoding(1251);

from quickfixn.

mgatny avatar mgatny commented on June 27, 2024

I wouldn't be opposed to exposing it as a SessionSetting. Although the FIX Protocol standard requires latin1, many firms (including very large ones) obviously do not adhere to it.

from quickfixn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.