Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 241490 - Provide a way to display ASCII BLOB content
Provide a way to display ASCII BLOB content
Status: VERIFIED FIXED
Product: db
Classification: Unclassified
Component: Show Data
8.0
PC Mac OS X
: P3 with 1 vote (vote)
: 8.0.1
Assigned To: Libor Fischmeistr
issues@db
netfix801
: PATCH_AVAILABLE
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-06 13:37 UTC by twolf2919
Modified: 2014-07-19 15:11 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments
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 - http://hg.netbeans.org/core-main/rev/df44f80d9a79

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 http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/df44f80d9a79
User: Libor Fischmeistr <lfischmeistr@netbeans.org>
Log: #241490: Provide a way to display ASCII BLOB content
Comment 6 matthias42 2014-07-19 15:11:28 UTC
Thank you!


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo