Bug 281999 - bad html charset would cause problem when doing a "File Search"
Summary: bad html charset would cause problem when doing a "File Search"
Status: NEW
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.html (show other bugs)
Version: 3.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: wst.html CLA
QA Contact: Nick Sandonato CLA
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2009-06-30 08:32 EDT by Finjon Kiang CLA
Modified: 2015-07-13 21:35 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Finjon Kiang CLA 2009-06-30 08:32:03 EDT
Error message:
  File 'phpbb/styles/subsilver2/template/viewtopic_print.html' has been skipped, problem while reading: ('{S_CONTENT_ENCODING}').
  {S_CONTENT_ENCODING}

Maybe this problem shouldn't be submitted here, but this place is the one I familar with only, in eclipse project. ^^

When doing a "File Search" in "*.html" files, the program would detect the encoding through the settings inside head tags. But when it find a charset that it doesn't know, the error message appeared like above. When the errors happened many times, the search action would stop. I can't find the preference setting to skip this problem when working with phpbb(or maybe some other applications). The original string is like below:

<meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" />
Comment 1 Toshihiro Izumi CLA 2009-07-07 03:01:42 EDT
It's reproducible but...
Can you edit the file in Eclipse (by HTML Editor)?

Open properties of the file (right-click on the file in PHP Explorer > Properties).
If "Text file encoding" is "Default (determined from content: {S_CONTENT_ENCODING})", do click "Other" and input appropriate encoding.

btw
This is an issue of WTP. Unfortunately, it seems that users cannot disable this bad behaviour(determined from content)...
Comment 2 Nitin Dahyabhai CLA 2010-10-05 17:45:18 EDT
Can you attach a file that shows this problem?
Comment 3 Ben Johnson CLA 2015-07-13 09:35:53 EDT
Version: Mars (4.5)
Build id: I20150603-2000

I just encountered the same problem with a CSS file that uses an invalid encoding string, so the issue is not unique to HTML files.

Simply placing any invalid character encoding string at the top of any CSS file causes the problem for me. For example:

@charset "hello-world";

This is a real-world example from a Laravel project that includes the third-party leafo/scssphp library. I'm not sure why the author of this file used this invalid encoding string, but the file is part of a test suite, so one must assume that this is intentional.

Whenever I attempt to perform a file search against a directory tree that contains this library, Eclipse chokes on the file that contains the above sample encoding line and produces the following error dialog:

Problems encountered during text search.
Problems encountered during text search.
File 'Intranet (Platform)/platform-intra/vendor/leafo/scssphp/tests/outputs/directives.css' has been skipped, problem while reading: ('hello-world').
hello-world

While I realize that I can specify a valid encoding type via the file's Properties dialog, this is impractical for large third-party libraries whose contents change all the time.

It would much better if Eclipse could be configured to ignore these invalid encoding strings, and ideally, default to some sensible encoding type if this scenario is encountered while searching.
Comment 4 Dawid Pakula CLA 2015-07-13 09:47:39 EDT
HTML and CSS editors are part of WTP SSE. Moving...