<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Inspector crashes if LANG env var specifies encoding"
   href="https://bugs.webkit.org/show_bug.cgi?id=167991">167991</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Inspector crashes if LANG env var specifies encoding
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Web Inspector
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mod-wkbz&#64;mt2015.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>inspector-bugzilla-changes&#64;group.apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I'm using WebKit2GTK+ 2.14.3 on Arch Linux, but this bug has been around for some time.

The only locale-related {LC_*, LOCALE, LANG} environment variable set on my system is &quot;LANG=es_ES.utf8&quot;. In this configuration, opening the WebKit2 inspector results in a &quot;Web Inspector encountered an internal error.&quot; page instead of a working inspector.

If I set LANG to &quot;es_ES&quot; or &quot;en_US&quot; or &quot;C&quot;, the inspector works. If I set LANG to the (invalid) &quot;es_ES.&quot;, the C library complains about an invalid locale as it should:

(process:15144): Gtk-WARNING **: Locale not supported by C library.
    Using the fallback 'C' locale.

The browser then runs in English, but the inspector still crashes in the same way.

Given that no other software complains about &quot;LANG=es_ES.utf8&quot;, the inspector should be fixed to also support such &quot;locale.encoding&quot; values.

The JS exception stack is attached below; it looks like IntlDateTimeFormat::initializeDateTimeFormat is really the problem here but I couldn't figure out how specifically.

-------
Inspected URL:        (unknown)
Loading completed:    false
Frontend User Agent:  Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/603.1 (KHTML, like Gecko) Version/10.0 Safari/603.1

Uncaught Exceptions:
 - TypeError: failed to initialize DateTimeFormat due to invalid locale (at LogTreeElement.js:32:107)
    DateTimeFormat &#64; [native code]
    toLocaleTimeString &#64; [native code]
    LogTreeElement &#64; LogTreeElement.js:32:107
    contentLoaded &#64; Main.js:247:63
    ? &#64; [native code]
 - TypeError: undefined is not an object (evaluating 'this.tabBrowser.updateLayout') (at Main.js:1512:20)
    _tabBrowserSizeDidChange &#64; Main.js:1512:20
    _windowResized &#64; Main.js:1401:34
    ? &#64; [native code]</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>