Web Downloaded Code and Hidden Characters

Background

Stole one line from the Web and can not even get it to work

 

SMH Moment

Another SMH moment. What good is to steal something and yet not be able to use it.

 

Error

Here is the stupid error, I am getting

Error Message

Image

executed-with-special-characters-20170120_1242pm

Textual


>accessChk_sqlServer.cmd

>..\AccessChk ûp sqlservr.exe ûf ûq ûv

Explanation

  1. Basically the – operator is being substituted with û

Review Code

Here is the code when I type it out in the Console

Image

view-with-special-characters

Textual

>type accessChk_sqlServer.cmd
..\AccessChk ûp sqlservr.exe ûf ûq ûv

Explanation

  1. Basically the – operator is being substituted with û

 

Clean Up

Notepad++

Launch Notepad++ and opened the file

Original Display

notepadplusplus-display-20160120-0108pm

Change Encoding to OEM-US

Let us change Encoding to OEM-US.

Here are our steps:

  1. Click on menu items
    • Encoding
    • Character sets
    • Western European
    • OEM-US

 

changeencodingtooem_us

 

Post Change Encoding

notepadplusplus-display-20160120-0113pm

 

Replace & Strip Out Special Characters

Find & Replace

Using Find & Replace to replace û with –

notepadplusplus-display-20160120-0115pm

 

Find & Replace – Post

Post “Find & Replace

notepadplusplus-display-20160120-0116pm

Explanation
  1. Please attention to the count of how many replacements was done

 

Save

Please save the revised document

Thankfully notepad++ color codes changed documents.

BTW, by Color Code I mean a red disk icon by the file name.

notepadplusplus-display-20160120-0120pm

 

Run Script

With the saved changes, took back to the console and re-ran the script.

executed-without-special-characters-20170120_0122pm

Ran successfully.

 

Dedicated

Dedicated to Mark Russinovich & Notepad++.

Notepad++ and XML Editing

Background

I need a way to quickly edit XML within my editor of choice, Notepad++.

What to do, but took to Google and see whether Notepad++ supports XML.

And, yes it does:

How to format XML in Notepad
http://stackoverflow.com/questions/3961217/how-to-format-xml-in-notepad

 

Auto Update

In Notepad++, to install or update plugins, I will access the menu option Plugins/Plugin Manager/”Show Plugin Manager”, select the plugin that I want, and click Install.

PlugInManager

But, no go.

Here is what happens when I try out PowerShell Lexer.

FirewallIssues

 

BTW, “PowerShell Lexer” provides syntax highlighting for Power-Shell.

The problem is a Proxy configuration and authentication issue.  And, the problem merits a far more interesting post, that I will save for another day.

For today, we will trod the laborer’s path and update manually.

XML Tools

Download

Where are the PlugIns?

http://sourceforge.net/projects/npp-plugins/files/

 

Where is the XML Tools PlugIn?

http://sourceforge.net/projects/npp-plugins/files/XML%20Tools/

As of today, the file that we will download will be Xml Tools 2.4.4 Unicode.zip.

 

Installation

Extract

Let us extract the compressed (zip) file

extractedFiles

 

Embed Files

  • Select all the files in the ext_libs folder unto Notepad++ home folder; in our case C:\Program Files (x86)\Notepad++
  • Copy xmltools under the main binary file (notepad++)

 

Review New Folder

Here is what our main line folder looks like:

mainFolder

 

Plugins

Here is the XMLTools.dll in the plugins folder:

XMLTools_Subdir

 

Verify

Re-launched Notepad++ and tried to encode XML.

Here are the options:

NoXMLEncodeUnderXMLTools

Here are some of the options under XML Tools:

  • Check XML syntax now
  • Validate now
  • Convert selection XML to text
  • Convert selection text to XML
  • Comment selection
  • Un-Comment selection

 

I am probably wrong, but it does not appear any of the options specifically address XML Encoding.

 

HTML Tools

XML Encode?

Took to Net to see if there is a more specific plugin for XML Encode.

From https://kollegaru.wordpress.com/2012/05/24/notepad-html-tag-plugin-easy-html-encode-decode-functions/, it seems I should try out HTMLTag.

Download

Where is the HTMLTag PlugIn?

http://sourceforge.net/projects/npp-plugins/files/HTMLTag/HTMLTag%20plugin%20v0.50/

HTMLTagFolders

 

Since June 14th, 2012, the HTMLTag Plugin is v.5 and available @ http://sourceforge.net/projects/npp-plugins/files/HTMLTag/HTMLTag%20plugin%20v0.50/

 

 

Installation

Extract

Let us extract the compressed (zip) file

HTMLTagFolderExtracted

 

Embed Files

  • Copy all the folders and files under the Applications’ plug-in folder.

 

Review New Folder

Here is what our main line folder looks like:

HTMLTagFolderAvailed

 

Verify

Again, re-launched Notepad++ and here are the options under Plugins\HTML Tag.

HTMLTagEncodeAndDecodeOptions

 

From the screen above, we are able to encode and decode HTML Entities. Note that same applies to XML.

 

Summary

So it seems both plugins are needed.

The XML Plugin for validating XML, and the HTML Plug-in for encoding and decoding XML/HTML.