microsoft / microsoft/sql-server-samples

Hex x81 value in Sales.Customers

Open
#428 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
11.2k
Forks
9.1k
Avg merge
2d 7h
Merged PRs (30d)
14

Description

Using WideWorldImporters-Standard v1.0 table Sales.Customers the value Prabhupāda shows up several times which does not appear to match any encoding I would expect.

Dumping the contents to UTF-8 through PowerShell are more interesting and show xC3 x84 xC2 x81, but the native SQL format shows xC4 x00 x81 x00.

SELECT CustomerName, 
       PostalAddressLine2, 
       WebsiteURL 
FROM   sales.Customers 
WHERE  CustomerName LIKE '%Prabhup%' 
        OR PostalAddressLine2 LIKE '%Prabhup%' 
        OR WebsiteURL LIKE '%Prabhup%' 

Is this intentional? The issue occurs between the Ä and the da, there is a Hex x81 unprintable character which appears in several rows of this table. Just typing this bug report, the  shows as a box, but in the preview it shows as a question mark. Copying/pasting this from SQL Server Managment Studio into Notepad++ shows the character as HOP, which I believe is the same side-effect of the UTF-8 conversion.

Testing against this value can be confusing as it has the tendency to insert whitespace characters, blocks or question marks in its place. A programmer often sees these unmappable characters when there's an encoding error -- common when mixing UTF8 and ANSI -- so it may surface as a false-positive to the naked eye.

Was this deliberate? I've searched everywhere for this text and unicode sequence and the only thing I can determine is that it is a mistake with the underlying data.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Sales.Customers table in the WideWorldImporters-Standard v1.0 sample and run the SQL query shown in the issue against the affected columns. Compare the stored value with its native SQL and PowerShell UTF-8 representations. Done means determining whether the x81 character is intentional and, if it is erroneous, correcting the sample data.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, sql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.