This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 241490 - Provide a way to display ASCII BLOB content
Summary: Provide a way to display ASCII BLOB content
Alias: None
Product: db
Classification: Unclassified
Component: Show Data (show other bugs)
Version: 8.0
Hardware: PC Mac OS X
: P3 normal with 1 vote (vote)
Assignee: Libor Fischmeistr
Depends on:
Reported: 2014-02-06 13:37 UTC by twolf2919
Modified: 2014-07-19 15:11 UTC (History)
1 user (show)

See Also:
Exception Reporter:

proposed patch v1 (38.84 KB, patch)
2014-04-13 21:00 UTC, matthias42
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description twolf2919 2014-02-06 13:37:22 UTC
We use BLOBS to store XML (and other) data and it would be really useful if DB Explorer could display this information.  Currently there is already a "Display as Image..." - maybe a "Display as Text..." could be added?  Alternatively, maybe the explorer could auto-detect that the content of a BLOB is all ASCII/UTF-8 and display it this way in the cell.
Comment 1 matthias42 2014-02-08 18:14:23 UTC
Autodetecting the "correct" encoding is hard - if not impossible. You can't seperate pure ASCII text from UTF-8 encoded text, that only contains "low range" characters (that map to ASCII). Imaging this:

<?xml version="1.0" charset="ISO-8859-15"?>

That coding does contain the EUR symbol, encoding this as UTF-8 and saving the content to database basicly destroys the document content, as the codepoint that represents EUR in ISO-8859-15 is most probably not the same as in UTF-8 (i did not check).

What is more, you need probably read a lot of the data to guess correctly.

From a quick glance:

Add a menu entry "Open as Text", the associated action then opens the Blob, read the $random_number bytes and does some basic checks:

- Is a BOM present?
- Is an XML declaration contained?

If one of the above is found, make an educated guess for a "default" charset. If none of the above holds true, use the "default" plattform charset as default (or better UTF8???). After that ask the user to choose encoding. An input window like the CLOB case could be used, with an drop down to change the encoding for saving.

This was put down, so that I don't forget it :-)
Comment 2 matthias42 2014-04-13 21:00:59 UTC
Created attachment 146726 [details]
proposed patch v1

Attached you can find an implementation of the feature. It is basic, but should do the job. For XML derivatives charset encoding is copied from the XML module.
Comment 3 markiewb 2014-07-09 21:42:28 UTC
@NB-Dev: Please review the patch.
Comment 4 Libor Fischmeistr 2014-07-10 09:59:32 UTC
Patch applied -

Thanks Matthias for it.
Comment 5 Quality Engineering 2014-07-19 10:18:59 UTC
Integrated into 'main-silver', will be available in build *201407190718* on (upload may still be in progress)

User: Libor Fischmeistr <>
Log: #241490: Provide a way to display ASCII BLOB content
Comment 6 matthias42 2014-07-19 15:11:28 UTC
Thank you!