Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Imporved the encoding charset using the Encoding class #658

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AffanShaikhsurab
Copy link
Contributor

PR Description

I have imporved the encoding where the user can specify the encoding and that same encoding type will be used to encode the data instead of previously default utf-8

I have used just in built Encoding class in the flutter which provide encoiding as follows as mentioned in the encoding.dart class

    // ISO_8859-1:1987.
    "iso_8859-1:1987": latin1,
    "iso-ir-100": latin1,
    "iso_8859-1": latin1,
    "iso-8859-1": latin1,
    "latin1": latin1,
    "l1": latin1,
    "ibm819": latin1,
    "cp819": latin1,
    "csisolatin1": latin1,

    // US-ASCII.
    "iso-ir-6": ascii,
    "ansi_x3.4-1968": ascii,
    "ansi_x3.4-1986": ascii,
    "iso_646.irv:1991": ascii,
    "iso646-us": ascii,
    "us-ascii": ascii,
    "us": ascii,
    "ibm367": ascii,
    "cp367": ascii,
    "csascii": ascii,
    "ascii": ascii, // This is not in the IANA official names.
    // UTF-8.
    "csutf8": utf8,
    "utf-8": utf8,
  };

we can add supoort for other enocding types using the charset encoding . Please let me how on your opinion .

Ps; None of this is made by ai

Related Issues

Checklist

  • I have gone through the contributing guide
  • I have updated my branch and synced it with project main branch before making this PR
  • I am using the latest Flutter stable branch (run flutter upgrade and verify)
  • I have run the tests (flutter test) and all tests are passing

Added/updated tests?

We encourage you to add relevant test cases.

  • Yes
  • No, and this is why: I would like to see the approch and once imporved i will write the testcase

OS on which you have developed and tested the feature?

  • Windows
  • macOS
  • Linux

@AffanShaikhsurab
Copy link
Contributor Author

soory for previous pr i didnt knew ai was not allowed for now on i wil make sure the code is written by me

@WannaCry016
Copy link

@AffanShaikhsurab is it solved?? can u send an ss that it is working.

@AffanShaikhsurab
Copy link
Contributor Author

yeah it works i will share you the screenshot soon

@ashitaprasad
Copy link
Member

encodingName extraction process is not right. Go through the code base to understand how content type is parsed

@WannaCry016
Copy link

encodingName extraction process is not right. Go through the code base to understand how content type is parsed

In this issue the content-type override is due to the http lib so it can be controlled ig so another method i found is to use the parent lib dart.io which gives full control I tried it was working the content override problem was solved but for it we have change the codebase as everywhere http client is used. Is there any other way??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to override Content-Type header
3 participants