Giter Club home page Giter Club logo

Comments (7)

barbushin avatar barbushin commented on July 18, 2024

Hi Alex

Can you please send me value of your ini_get('mbstring.internal_encoding')?
And it will be great if you attach call backtrace of this error.

Before I fixed this bug, you can try some workaround issue, try to set $phpConsoleConnector->setServerEncoding('utf'-8');.

Thank you!

from php-console.

alexborisov avatar alexborisov commented on July 18, 2024

I've fixed the issue. Please review my pull request #4

from php-console.

alexborisov avatar alexborisov commented on July 18, 2024

For your record the issue was being caused by setPassword() calling on self::CLIENT_ENCODING which by default was set to utf-8 instead of UTF-8

from php-console.

barbushin avatar barbushin commented on July 18, 2024

I don't think that this issue must work.

  1. mb_convert_encoding() does not care about encoding name case
  2. See source code of \PhpConsole\Connector::setServerEncoding() method

Once again:

Can you please send me value of your ini_get('mbstring.internal_encoding')?
And it will be great if you attach call backtrace of this error.

from php-console.

alexborisov avatar alexborisov commented on July 18, 2024

I thought so too, but it seems to have fixed the issue. I no longer get that error.

ini_get('mbstring.internal_encoding') result = ""
ini_get('mbstring') result = false

So it's ignored and instead the value of self::CLIENT_ENCODING is assumed.

Hmm... I can see what your doing with setServerEncoding(), however:

\PhpConsole\Connector::setPassword() line 311 calls This->convertEncoding passing in $toEncoding as self::CLIENT_ENCODING. This ends up passing in the raw uppercased value i manually set. setServerEncoding() on the other side only sets $this->serverEncoding to the lowercased representation. Hence convertEncoding() line 362 calls @mb_convert_encoding("password, 'UTF-8', 'utf-8') and that seems to make it happy. If you pass it a lowercased value as the second parameter it complains about encoding.

I cant find any reference that the encoding type MUST be uppercase so it is indeed odd.

Here is a backtrace from right after that call on line 367

http://pastebin.com/raw.php?i=wwAf2kb3

from php-console.

barbushin avatar barbushin commented on July 18, 2024

I have made some fix with trivial refactoring to using UTF-8 everywhere. See 8fe019b

So I think we can close this issue.
Alex, thanks for bug report & thanks for help!

from php-console.

alexborisov avatar alexborisov commented on July 18, 2024

Your welcome! 👍

from php-console.

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.