Skip to content

Possible deep-rooted issue of Conversion of String Encodings in http response body. #14

Closed
@luke-hill

Description

@luke-hill

Preface

This is a bit of a long convoluted chain (So apologies in advance). I'm not even sure if this is 100% fixable. But I'll post it here and try include as much info.

When using Selenium::Webdriver.logger in standard selenium practice, you can pipe debug messages. The following issue occurs (Page under test is: https://www.citizensadvice.org.uk/immigration/ - A national charity website).

Simple reproduction case

  1. Grab text of footer using selenium. With the footer on this website, we have a © character.
  2. If selenium logging is set, pipe some debug info to the selenium logger (This is a standard ruby logger)
  3. Whilst debugging the info here. We get a Ruby Logger Kernel.warn message
log writing failed. "\xC2" from ASCII-8BIT to UTF-8

Root cause

The root cause issue (I believe), is with this process flow. The capitalised letters refer to which library is doing the code processing at that time.

  1. SELENIUM - A request payload is built up using a standard API Payload structure
  2. NET::HTTP - The request is sent using the Selenium HTTP adapter (Which is just an instance of the net http one).
  3. NET::HTTP - The request object is returned with all the standard properties - This is where the non-conformancy is generated.
  4. SELENIUM - Selenium then processes this through a series of check to ensure safety
  5. LOGGER - If configured it will do a debug-trace log (We have this set to on) - This is where the error is bubbled up.

Next steps?

I am not 100% sure. I think it would be nice to know why this encoding conversion is happening. I can patch it fine my end. But it has been mentioned to try trace exactly where / why it's occurring.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions