[Question]
  [
This is code golf. For this challenge, I will accept a method (you don't need a full program), but the method signature does count towards the byte count and I want to see the full signature (not a lamdba). The input for the method is an integer array with 81 elements. The output/return value from the method is a string that represents the array as an ascii sudoku board.
If you're using an esoteric language or something that absolutely doesn't have methods, you can adapt, but if the language supports this at all I want to see something might actually be plugged into a "real" ungolfed program, even if the method body itself is a pain to work with. The requirement is not meant to block languages like Jelly or 05AB1E, but to make it easier for languages like Java to build something that makes sense for that platform.
For the input, integer values 1-9 should have obvious meanings. A 0 should always be interpreted as a blank cell. You may also interpret anything else outside the 1-9 range as a blank cell, but this is not required. Positioning from the array to the puzzle starts at the top left and fills each row from left to right before moving to the next row.
For the boxes, I want double lines around the outside and between each 3x3 region, and single lines between other cells. These should be drawn with line drawing characters (if your I/O format represents strings as a sequence of bytes rather than a sequence of characters, you should represent them in a well-known encoding such as UTF-8 or codepage 347).
For this challenge, I am **NOT** asking you to generate the sudoku puzzle. That is the input for the function. I am **NOT** asking you to solve the puzzle. I'm just asking you to produce a string to "draw" what you're given (in as few bytes as possible).
### Example Input:
Values for the array:
```
{ 8, 5, 0, 0, 0, 2, 4, 0, 0, 7, 2, 0, 0, 0, 0, 0, 0, 9, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 7, 0, 0, 2, 3, 0, 5, 0, 0, 0, 9, 0, 0 ,0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 7, 0, 0, 1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6, 0, 4, 0}
```
The values can use whatever mechanism is natural for your language: int[], ArrayList, sequence, tuple, string of digits, whatever, as long as you have a value in the input for every cell (no maps for only populated cells to positions). Remember that the input is supplied... it is not part of your byte count. But the input might represent *any* sudoku puzzle, and the puzzle *might not even have a valid solution*. You do get to assume that puzzle *is* printable. You won't get something with 82 elements, for example.
You also get to assume a reasonable fixed-width font.
### Corresponding Output:
```
╔═══╤═══╤═══╦═══╤═══╤═══╦═══╤═══╤═══╗
║ 8 │ 5 │   ║   │   │ 2 ║ 4 │   │   ║
╟───┼───┼───╫───┼───┼───╫───┼───┼───╢
║ 7 │ 2 │   ║   │   │   ║   │   │ 9 ║
╟───┼───┼───╫───┼───┼───╫───┼───┼───╢
║   │   │ 4 ║   │   │   ║   │   │   ║
╠═══╪═══╪═══╬═══╪═══╪═══╬═══╪═══╪═══╣
║   │   │   ║ 1 │   │ 7 ║   │   │ 2 ║
╟───┼───┼───╫───┼───┼───╫───┼───┼───╢
║ 3 │   │ 5 ║   │   │   ║ 9 │   │   ║
╟───┼───┼───╫───┼───┼───╫───┼───┼───╢
║   │ 4 │   ║   │   │   ║   │   │   ║
╠═══╪═══╪═══╬═══╪═══╪═══╬═══╪═══╪═══╣
║   │   │   ║   │ 8 │   ║   │ 7 │   ║
╟───┼───┼───╫───┼───┼───╫───┼───┼───╢
║   │ 1 │ 7 ║   │   │   ║   │   │   ║
╟───┼───┼───╫───┼───┼───╫───┼───┼───╢
║   │   │   ║   │ 3 │ 6 ║   │ 4 │   ║
╚═══╧═══╧═══╩═══╧═══╧═══╩═══╧═══╧═══╝
```
  
[Answer]
# [Python 3](https://docs.python.org/3/), 232 bytes
Thanks to those who helped to golf this down.
Encryption within encryption...
```
q=lambda x,y:x+y+x+y+x
r=lambda a,b,c,d,e:a+q(q(b*3,c),d)+e+"\n"
print(((r(*"╔═╤╦╗")+q(q("║ %d │ %d │ %d "*3+"║\n",r(*"╟─┼╫╢")),r(*"╠═╪╬╣"))+r(*"╚═╧╩╝"))%eval(input())).replace(*"0 "))
```
[Try it online!](https://tio.run/##hY5fSsQwEMbf9xQhsJA0g1S7664L3sSXtA240K1tqbJ9E0@g0EEQRFFR/HMETzMXqTE1ZWGFhS/ky28y30zR1KdnedR15XGmV3Gq2RqaxVo1yp1R5bGGGBJIwSy0KkUp4iCCREIqlVH8JOejolrmtRCiEgEnbAmvCV8IXwlvuXQtFt@wccqovdq4eBCp34rNgL73gdpLar8JPwmfuJR/@NFFfhB@ET5brHp85/Ab4TvhvcVjc6EzscyL81pIKfcqU2Q6MfZvyGy568Qc2BRY6HUAbOL9zD3DLR15M/mvOmjfhwzJkTPT7SgGO9N6zTd2G6bMdnXZuYfDwvIH "Python 3 – Try It Online")
To be golfed.
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~398~~ ~~395~~ 291 bytes
Saved 3 bytes by working through the string reversed, and 104 (!) bytes thanks to Leaky Nun.
```
#include<locale.h>
#define q(x,y) x y x y x
#define D L"╝"q(q("═══","╧"),"╩")"╚"q(q("\n║"q(q(" & ","│"),"║")"║","\n╢"q(q("───","┼"),"╫")"╟"),"\n╣"q(q("═══","╪"),"╬")"╠")"\n╗"q(q("═══","╤"),"╦")"╔"
i;f(int*t){setlocale(LC_ALL,"");for(i=721;i--;)wprintf(L"%lc",D[i]%19?D[i]:*t++?48+t[-1]:32);}
```
[Try it online!](https://tio.run/##hZBrSgMxFIX/zyouKZWkzUinD/uItYj9OTuoRcp0RgPj1NaILaUgrsBCiyCIoqL4WIKr6UbGPJxBaEE4SU5yv5wb4tnHnhfHGR554UXf3w0HXi/0t0/2rEzfD3jkwxCP6YTAGCZmpIU2uGi1vEdDPMTS3BghKv0bImp5R0TOd4Y4jFbLubGwBQpbXBtsrrG5PFLM02/g4spIk9@G/NTkg9oo9HlT7w@Dfmn0Uc6KvN1EvhjyVZMLZHEWYB6JnCDTc1@Yn8DuwdG@61KECAsGI8yb1aLDuG0zcnk2knSAXZQNPUTbHd7NOvWWWhs5kc@3yrW86NhOt1EqEjaLJQynPR5hMrWUF50uNGEKNQoVCoVERQrlxFf1trCmemLKm6qpnCQkTS5pU1mPAvpvmlHtz9vSLtX/bsm@O@mDYcasAAvCrFn8Aw "C (gcc) – Try It Online")
## [C (gcc)](https://gcc.gnu.org/), 395 bytes
I'll keep this here so its more evident as to how the program works.
```
#include<locale.h>
#define A L"\n╢───┼───┼───╫───┼───┼───╫───┼───┼───╟"
#define B L"\n║ & │ & │ & ║ & │ & │ & ║ & │ & │ & ║"
#define C L"\n╣═══╪═══╪═══╬═══╪═══╪═══╬═══╪═══╪═══╠"
#define E B A B A B
#define D L"╝═══╧═══╧═══╩═══╧═══╧═══╩═══╧═══╧═══╚"E C E C E L"\n╗═══╤═══╤═══╦═══╤═══╤═══╦═══╤═══╤═══╔"
i;f(int*t){setlocale(LC_ALL,"");for(i=721;i--;)wprintf(L"%lc",D[i]%19?D[i]:*t++?48+t[-1]:32);}
```
[Try it online!](https://tio.run/##S9ZNT07@/185My85pzQl1SYnPzkxJ1Uvw45LOSU1LTMvVcFRwUcpJu/R1EWPpjTA0B7s7KmrqaRmvhLceieo9RMV1BQeTWlCkMSJIAxyhhq0@NHUCTC0Cgd7DZXULEBY7wr0iSMEw8VcgE56NHUukoblONgrqaRmlpIrMCAgGBIc05Fkl@BgL6OSmilKXJnWaRqZeSVaJZrVxaklkNSm4eMc7@jjo6OkpGmdll@kkWlrbmRonamra61ZXlAEVJ2m4aOkmpOspOMSnRmramhpD6KttEq0te1NLLRLonUNY62MjTSta/8DFSvkJmbmaWhWc4HYJdGxCrYK1QoWOgqmOgoGMGSko2ACY5uDuQYYyBLGMMEmC0eGMEPgJhuDGaaYRinoEDQNgiyQ3Aa3xZyQLqC9ZnAHK9Rac6VplGhac9X@BwA "C (gcc) – Try It Online")
Working with unicode in C is... costly. Takes input as an `int*` as shown in the link and in the specification.
I'm going to see if I can save bytes using some number magic instead of hardcoding the string.
[Answer]
# [PHP](https://php.net/), 297 bytes
```
<?for(;$l<19;$l++)echo$l&1?strtr(vsprintf(str_pad("",67,"║ %d │ %d │ %d "),array_slice($_GET,9*($l/2^0)-9,9)),0," "):str_pad([╔,╟,╠,╚][$b=$l?$l<18?$l%6<1?2:1:3:0],108,strtr("11101110111".[╦,╫,╬,╩][$b],[[╤,═],[┼,─],[╪,═],[╧,═]][$b])).[╗,╢,╣,╝][$b],"
";
```
[Try it online!](https://tio.run/##hZDbSsNAEIbv@xRhSWXXjppN25xLrsQX8C7EEHsghWBDEgTvxCdQSBAEsagoHh7Bp8mLxEliQqFCYf7df2Z3v53dKIhKy46CqCd6J8enE0cDYQyC1IYMwqj1ap1KW6G3ZvTfahe8hXTkYW3G2ygBdtKa0DZ6625Rd53Ce5WuYdcsF6uYmmJocR3HwYDNp8FKDPe4naRxGtPLJIqXF@mCYupF/owSAooKpMjvhP5MKLKbjYkw8OPYv/KScDmd0/pXQd@nYngkn0nsQAedMXwewZ1GC3SKPIMif0KtUQ@uI55PxNCuetJw7CsWt2WDG0NDcoFLGjSdEc659CdyiJQ3PP2F@kZ9VBQXHCy/YnqLtsh@oMiuK5d/trX8vXb1bsYqyj0WnlEvqMeGQnrELMtf "PHP – Try It Online")
Expanded
```
for(;$l<19;$l++)  # loop thrpugh lines
  echo$l&1 # Output
    ?strtr(
        vsprintf(str_pad("",67,"║ %d │ %d │ %d ") # formated string for lines with numbers
        ,array_slice($_GET,9*($l/2^0)-9,9)) # nine items of the input array
      ,0," ") #replace zeros with space
    :str_pad([╔,╟,╠,╚][$b=$l?$l<18?$l%6<1?2:1:3:0] # start character non number lines and switch number four cases
      ,108 # fill too 108 bytes
      ,strtr("11101110111".[╦,╫,╬,╩][$b] # with string 
        ,[[╤,═],[┼,─],[╪,═],[╧,═]][$b]))  #replace ones and zero with the two character in array chosed 
    .[╗,╢,╣,╝][$b] # end row with chosen character
  ,"
    "; # end line with new line
```
used functions for both versions
[vsprintf](http://php.net/manual/en/function.vsprintf.php) , [strtr](http://php.net/manual/en/function.strtr.php) , [str\_pad](http://php.net/manual/en/function.str-pad.php) , [array\_slice](http://php.net/manual/en/function.array-slice.php) , [array\_chunk](http://php.net/manual/en/function.array-chunk.php)
# [PHP](https://php.net/), 313 bytes
```
<?$r=($s=str_pad)(╔,108,($t=strtr)(($p=11101110111).╦,[╤,═])).╗;foreach(array_chunk($_GET,9)as$v)$r.=$t(vsprintf($s("
",68,"║ %d │ %d │ %d "),$v),0," ").(++$k%9?$k%3?$s("
╟",109,$t($p.╫,[┼,─])).╢:$s("
╠",109,$t($p.╬,[╪,═])).╣:"");echo$r.$s("
╚",109,$t($p.╩,[╧,═])).╝;
```
[Try it online!](https://tio.run/##hZDdSsMwFMfv9xQhZJCww2jdV7taeiW@gHdjlNJtVAZbSOvAO/EJFBoEQRQVhx@P4NPkRWratd3GhMFJck5y/v/zIzzi2anHI94g/vnZhTuyAPUAGVWcAOpW@aAojYOwq6T732sdZmVSO3eKpHdoheCo2yasHbZ6yuCYSs/t18BjJyPCpSR240T4PJgwqmQKpmEBJUl@mQhGKeGuaZpGuVhbyQ8YKfkOSt6NWV4/OLOlmAZhRAMhgms/jK4Wc1p8K9gsiMmKEdF2SUJXMReXi2Smh1LcwNC3ACt5j5oTpNLbnQMz0Cr9GVinbdpqkXnT9vTW8Qqpks9Yk9qgTQnXDN@aKf0Fld5smF6HZd/Lft9Pzv61ZX8bYsycaRgtNWIpedyXfOaS9Vby5GTZHw "PHP – Try It Online")
[Answer]
# T-SQL, ~~445~~ 437 bytes (in 381 characters)
```
DECLARE @r INT=0,@ NVARCHAR(999)=N'╔=╤=╤=╦=╤=╤=╦=╤=╤=╗P'p:SELECT @+=FORMAT(CAST(SUBSTRING(a,@r*9+1,9)AS INT),N'║ 0 │ 0 │ 0 ║ 0 │ 0 │ 0 ║ 0 │ 0 │ 0 ║P')FROM t
SET @r+=1IF @r=9SET @+=N'╚=╧=╧=╩=╧=╧=╩=╧=╧=╝P'ELSE IF @r%3=0SET @+=N'╠=╪=╪=╬=╪=╪=╬=╪=╪=╣P'ELSE SET @+=N'╟-┼-┼-╫-┼-┼-╫-┼-┼-╢P'IF @r<9GOTO p
PRINT REPLACE(REPLACE(REPLACE(REPLACE(@,'=',N'═══'),'-',N'───'),'0',' '),'P',CHAR(13))
```
Input is via a string of digits stored in column *a* of pre-existing table *t*, [per approved methods](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods/5341#5341).
**Format and Explanation**:
```
DECLARE @r INT=0, @ NVARCHAR(999)= N'╔=╤=╤=╦=╤=╤=╦=╤=╤=╗P'
p:
    SELECT @+= FORMAT(CAST(SUBSTRING(a, @r*9+1, 9) AS INT),
        N'║ 0 │ 0 │ 0 ║ 0 │ 0 │ 0 ║ 0 │ 0 │ 0 ║P') FROM t
    SET @r+=1
    IF @r=9 SET @+= N'╚=╧=╧=╩=╧=╧=╩=╧=╧=╝P'
    ELSE IF @r%3=0 SET @+= N'╠=╪=╪=╬=╪=╪=╬=╪=╪=╣P'
    ELSE SET @+= N'╟-┼-┼-╫-┼-┼-╫-┼-┼-╢P'
IF @r<9 GOTO p
PRINT REPLACE(REPLACE(REPLACE(REPLACE(@, '=',N'═══'), '-',N'───'), '0',' '), 'P',CHAR(13))
```
In the top line of the loop I'm getting the next 9 digits of the input string from column *a* of pre-existing table *t*.
I convert that string of digits to an integer, and use the .Net `FORMAT` function to display them using a custom text template `'║ 0 │ 0 │ 0 ║ 0 │ 0 │ 0 ║ 0 │ 0 │ 0 ║P'`.
After that I just append the appropriate divider line, and make some byte-saving replacements before output.
Output is displayed in the results pane:
```
╔═══╤═══╤═══╦═══╤═══╤═══╦═══╤═══╤═══╗
║ 8 │ 5 │   ║   │   │ 2 ║ 4 │   │   ║
╟───┼───┼───╫───┼───┼───╫───┼───┼───╢
║ 7 │ 2 │   ║   │   │   ║   │   │ 9 ║
╟───┼───┼───╫───┼───┼───╫───┼───┼───╢
║   │   │ 4 ║   │   │   ║   │   │   ║
╠═══╪═══╪═══╬═══╪═══╪═══╬═══╪═══╪═══╣
║   │   │   ║ 1 │   │ 7 ║   │   │ 2 ║
╟───┼───┼───╫───┼───┼───╫───┼───┼───╢
║ 3 │   │ 5 ║   │   │   ║ 9 │   │   ║
╟───┼───┼───╫───┼───┼───╫───┼───┼───╢
║   │ 4 │   ║   │   │   ║   │   │   ║
╠═══╪═══╪═══╬═══╪═══╪═══╬═══╪═══╪═══╣
║   │   │   ║   │ 8 │   ║   │ 7 │   ║
╟───┼───┼───╫───┼───┼───╫───┼───┼───╢
║   │ 1 │ 7 ║   │   │   ║   │   │   ║
╟───┼───┼───╫───┼───┼───╫───┼───┼───╢
║   │   │   ║   │ 3 │ 6 ║   │ 4 │   ║
╚═══╧═══╧═══╩═══╧═══╧═══╩═══╧═══╧═══╝
```
I previously had some additional replacements for some of the other drawing characters, but they ultimately didn't save me bytes.
**EDIT 1**: Saved 8 bytes by starting `@r` at zero instead of 1, and removing some unneeded spaces.
[Answer]
# [Retina](https://github.com/m-ender/retina), ~~196~~ 167 bytes
```
.{27}
¶N#=XZ#Q¶|$&
\d{9}\B
$&¶M#─┼Y#P¶|
\d{3}
 $& |
\B\d
 │ $&
^¶.*
B#=RT#E
$
¶H#=UW#K
+`#([^#¶]+)([^#¶])#
#$1#$2#$1#$2#$1#
#(.)#
$1$1$1
T`0=|#L` ═-╬
```
[Try it online!](https://tio.run/##TYy5CsJQEEX7@YrAPIILhsmiMUWagCC4oKK4RYkQCxsLsYsB8Qss4l9Yv8rqfcr7kfjigt6B4c49lzlsj7v9Js@NxHJTELyP/myBQ8FPTIcwTrw0DIDpgvdQZmeZPeY4ULBAdgoa0zXlgzAGTWYXdcJacKMCAfqjMbaAqZdt9CdT7EA1wtJyjYKvquWPKSMgM5FZvw1YMlTMzGJgHJF/wm6kydu1Jm/3PG/WichyiFyLXvKIHPrKJFdRm@pv8EeImlRA0/0ldkMVng "Retina – Try It Online") Takes input as a string of length 81. Explanation: Because the box drawing characters cost three bytes, the unicode code points `═-╬` are represented in the code using `=|#A-Z` (not all the characters are used but sticking to ranges saves bytes). Additionally the rows are compressed using `#` signs: `a#bcd#e` expands to `abbbcbbbcbbbdbbbcbbbcbbbdbbbcbbbcbbbe`.
```
.{27}
¶N#=XZ#Q¶|$&
```
Inserts `╠═══╪═══╪═══╬═══╪═══╪═══╬═══╪═══╪═══╣` for every third row, plus a `║` at the start of every group of 27.
```
\d{9}\B
$&¶M#─┼Y#P¶|
```
Inserts `╟───┼───┼───╫───┼───┼───╫───┼───┼───╢` between the other rows, plus `║`s at the start of those rows.
```
\d{3}
 $& |
```
Inserts `║`s after every three digits. All the `║`s have now been inserted.
```
\B\d
 │ $&
```
Inserts `|`s between all the remaining pairs of digits. (This one is the actual box drawing character rather than a pipe. Unfortunately the characters `─│┼` have codes too far apart from each other and the double box characters to make it worth while using placeholders.)
```
^¶.*
B#=RT#E
```
Changes the first row to `╔═══╤═══╤═══╦═══╤═══╤═══╦═══╤═══╤═══╗` (this saves 1 byte over not adding the first row in the first place).
```
$
¶H#=UW#K
```
Adds `╚═══╧═══╧═══╩═══╧═══╧═══╩═══╧═══╧═══╝` after the last row.
```
+`#([^#¶]+)([^#¶])#
#$1#$2#$1#$2#$1#
```
Expands `a#bcd#e`, first to `a#bc#d#bc#d#bc#e`, then to `a#b#c#b#c#b#d#b#c#b#c#b#d#b#c#b#c#b#e`.
```
#(.)#
$1$1$1
```
Changes `#b#` to `bbb`. This completes the decompression.
```
T`0=|#L` ═-╬
```
Deletes all the zero entries, and replaces the placeholders with the box drawing characters.
[Answer]
# JavaScript (ES6), 246 bytes / 198 chars
```
(n,r=(x,y)=>x+y+x+y+x,q=s=>([u,w,x,y,z]=[...s[0]],u+r(r(w+w+w,x),y)+z+`
`))=>q`╔═╤╦╗`+n.reduce((o,v,i)=>o+"║││"[i++%3]+` ${v||" "} `+(i%9?e:`║
`+(i-27&&i-54?i<81?q`╟─┼╫╢`:e:q`╠═╪╬╣`)),e="")+q`╚═╧╩╝`
```
Input is an array of integers. Ended up using the same two helper functions as [Leaky Nun's Python answer](https://codegolf.stackexchange.com/a/126934/69583), so credit goes there.
### If `function` is required, 263 bytes / 215 chars
```
function g(n,r=(x,y)=>x+y+x+y+x,q=s=>([u,w,x,y,z]=[...s[0]],u+r(r(w+w+w,x),y)+z+`
`)){return q`╔═╤╦╗`+n.reduce((o,v,i)=>o+"║││"[i++%3]+` ${v||" "} `+(i%9?e:`║
`+(i-27&&i-54?i<81?q`╟─┼╫╢`:e:q`╠═╪╬╣`)),e="")+q`╚═╧╩╝`}
```
## Test Snippet
Any input of 81 numbers is supported (`1234`, `1, 2, 3, 4`. `[1 2 3 4]`, etc). Best viewed as full page.
```
f=
(n,r=(x,y)=>x+y+x+y+x,q=s=>([u,w,x,y,z]=[...s[0]],u+r(r(w+w+w,x),y)+z+`
`))=>q`╔═╤╦╗`+n.reduce((o,v,i)=>o+"║││"[i++%3]+` ${v||" "} `+(i%9?e:`║
`+(i-27&&i-54?i<81?q`╟─┼╫╢`:e:q`╠═╪╬╣`)),e="")+q`╚═╧╩╝`
onload=I.oninput=_=>O.innerHTML=(m=I.value.match(/\d/g))&&m.length==81?f(m.map(x=>+x)):''
```
```
<textarea id=I rows=3 style="width:95%">8, 5, 0, 0, 0, 2, 4, 0, 0, 7, 2, 0, 0, 0, 0, 0, 0, 9, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 7, 0, 0, 2, 3, 0, 5, 0, 0, 0, 9, 0, 0 ,0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 7, 0, 0, 1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6, 0, 4, 0</textarea>
<pre id=O>
```
[Answer]
# [SOGL V0.12](https://github.com/dzaima/SOGL), ~~174~~ ~~172~~ ~~164~~ ~~160~~ 158 [bytes](https://github.com/dzaima/SOGL/blob/master/chartable.md)
```
«ž#>]Wž²6√±_ΕΨ╥╬]v←ē⅓ZΗ⌡z∫◄‽q   §↑╗∑Ολ[Μ↕z↓/∆Yn⁄:Ο║χ≥¾▓g*≈]═+π℮─6⁽SE/⁷,0+►Ƨ⌡u\^⁄-▼0cΦ“╤─┼╬│║═╔╗╚╝”Φ⅜nΡ¡ΞΨīŗ(`½│uģ“ ╬ζ─{ζ} 6Δ¹∑A'⁄─{IaW}¹∑#¶ŗ3 ¶ŗ ”+Ƨøp+!!┌d0@ŗčŗ
```
Overly long explanation:
```
...“                          push a big base-43 encoded number; will be used later. It's pushed here to save a byte on a quote
    ...”                      push "╤─┼╬│║═╔╗╚╝" - the chars in SOGLs encoding
        ...“                  push 679301851737965572513837476350078477
             ╬                push "╬"
              ζ               convert it to its codepoint (9580)
               ─              convert that number to an array of base-9580 numbers
                {ζ}           convert each number to a character (pushing each on the stack)
                    6Δ        push all ascii chars up to 6 (" !"#$%&'()*+,-./0123456")
                      ¹∑      join all the strings on the stack together ("╤─┼╬│║═╔╗╚╝╦╟╫╢╠╪╣╧╩ !"#$%&'()*+,-./0123456")
                        A     save on variable `A`. Now ontop of the stack is the 1st big number
                         '⁄─  onvert from base 43
{   }                           for each number do
 I                                increase
  aW                              get its position in the variable A
     ¹∑                         join all the strings ontop of the stack (the loop above pushed each char separately)
       #¶ŗ                      replace quote (") characters with newlines
          3 ¶ŗ                  replace 3s with "¶"
               ”+               append "”"
                 Ƨøp+           append "øp"
                     !!         execute the created code as SOGL
                       ┌        push "-"
                        d       push variable d - defaults to string input. In a full program could be set as an input
                         0@ŗ    replace zeroes with spaces
                            č   chop into an array
                             ŗ  replace ["-" with input chopped - so each iteratively]
```
The program that's executed:
```
───!#
 - $
¶%&¶'(
)╪)╪)+
)╤)╤),
)╧)╧).
┼#
+╬+/
0!╫0!1
,╦,2
.╩.4
5│$║&
#0
═══)
$│$5
║&&%
╠/╬+╣6'*
╟1╫0!╢(
(6
╔2╦,╗6'**╚4╩.╝”øp
```
where all but last line are just `in the entire program replace occurrences of the last char of this line with the rest of this line`. This is the reason it was possible to make half of the chars just random ascii (but getting so that spaces, dashes, and quotes are usefully used took a while to figure out)
```
...”    push the whole sudoku grid
    øp  print nothing (prevents bug that this code would already print and pop the result)
```
[Try it Here!](https://dzaima.github.io/SOGLOnline/?code=JUFCJXUwMTdFJTIzJTNFJTVEVyV1MDE3RSVCMjYldTIyMUElQjFfJXUwMzk1JXUwM0E4JXUyNTY1JXUyNTZDJTVEdiV1MjE5MCV1MDExMyV1MjE1M1oldTAzOTcldTIzMjF6JXUyMjJCJXUyNUM0JXUyMDNEcSUwOSVBNyV1MjE5MSV1MjU1NyV1MjIxMSV1MDM5RiV1MDNCQiU1QiV1MDM5QyV1MjE5NXoldTIxOTMvJXUyMjA2WW4ldTIwNDQlM0EldTAzOUYldTI1NTEldTAzQzcldTIyNjUlQkUldTI1OTNnKiV1MjI0OCU1RCV1MjU1MCsldTAzQzAldTIxMkUldTI1MDA2JXUyMDdEU0UvJXUyMDc3JTJDMCsldTI1QkEldTAxQTcldTIzMjF1JTVDJTVFJXUyMDQ0LSV1MjVCQzBjJXUwM0E2JXUyMDFDJXUyNTY0JXUyNTAwJXUyNTNDJXUyNTZDJXUyNTAyJXUyNTUxJXUyNTUwJXUyNTU0JXUyNTU3JXUyNTVBJXUyNTVEJXUyMDFEJXUwM0E2JXUyMTVDbiV1MDNBMSVBMSV1MDM5RSV1MDNBOCV1MDEyQiV1MDE1NyUyOCU2MCVCRCV1MjUwMnUldTAxMjMldTIwMUMlMjAldTI1NkMldTAzQjYldTI1MDAlN0IldTAzQjYlN0QlMjA2JXUwMzk0JUI5JXUyMjExQSUyNyV1MjA0NCV1MjUwMCU3QklhVyU3RCVCOSV1MjIxMSUyMyVCNiV1MDE1NzMlMjAlQjYldTAxNTclMjAldTIwMUQrJXUwMUE3JUY4cCslMjElMjEldTI1MEMlMkMwQCV1MDE1NyV1MDEwRCV1MDE1Nw__,inputs=ODUwMDAyNDAwNzIwMDAwMDA5MDA0MDAwMDAwMDAwMTA3MDAyMzA1MDAwOTAwMDQwMDAwMDAwMDAwMDgwMDcwMDE3MDAwMDAwMDAwMDM2MDQw)  
The online interpreter code is more correct because tabs don't work with SE
-8 bytes: brute force replacement compressing the entire board, then replacing foreign chars (to the codepage) with their codepoints. Doing this took an hour less than the old program...  
-4 bytes: compressing the compressed string...  
-2 bytes: using a variable+string instead of array
[Answer]
## Batch, 332 bytes
```
@echo off
set/ps=
set s=%s:0= %
call:l É Í Ñ Ë »
set t="Ç Ä Å × ¶"
for %%i in (%t% %t% "Ì Í Ø Î ¹" %t% %t% "Ì Í Ø Î ¹" %t% %t% "È Í Ï Ê ¼")do call:c %%~i
exit/b
:c
set t=º
for %%j in (³ ³ º ³ ³ º ³ ³ º)do call set t=%%t%% %%s:~,1%% %%j&call set s=%%s:~1%%
echo %t%
:l
set t=%2%2%2%3%2%2%2%3%2%2%2
echo %1%t%%4%t%%4%t%%5
```
Needs the console to be in CP437. If that's not your default, then you can change it using the `CHCP 437` command if your console is set to TrueType fonts. (It will only work with raster fonts if CP437 is already your default code page.) This is what the code looks like in CP437:
```
@echo off
set/ps=
set s=%s:0= %
call:l ╔ ═ ╤ ╦ ╗
set t="╟ ─ ┼ ╫ ╢"
for %%i in (%t% %t% "╠ ═ ╪ ╬ ╣" %t% %t% "╠ ═ ╪ ╬ ╣" %t% %t% "╚ ═ ╧ ╩ ╝")do call:c %%~i
exit/b
:c
set t=║
for %%j in (│ │ ║ │ │ ║ │ │ ║)do call set t=%%t%% %%s:~,1%% %%j&call set s=%%s:~1%%
echo %t%
:l
set t=%2%2%2%3%2%2%2%3%2%2%2
echo %1%t%%4%t%%4%t%%5
```
[Answer]
# With ideas harvested from other answers:
## [C# (.NET Core)](https://www.microsoft.com/net/core/platform), 401 bytes, 349 Chars
```
string s(string x){Func<string,string,string>q=(m,n)=>m+n+m+n+m;var a="╔"+q(q("=","╤"),"╦")+"╗";for(var i=0;i<9;) {a+=int.Parse(x.Substring(i*9,9)).ToString("\n║"+q(q(" 0 ","│"),"║")+"║\n")+(i++<8?(i%3>0?"╟"+q(q("-","┼"),"╫")+"╢":"╠"+q(q("=","╪"),"╬")+"╣"):"╚"+q(q("=","╧"),"╩")+"╝");}return a.Replace("=","═══").Replace("-","───").Replace("0"," ");}
```
### Ungolfed:
```
static public string s(string x)
{
    Func<string,string,string>q=(m,n)=>m+n+m+n+m;
    var a="╔"+q(q("=","╤"),"╦")+"╗";
    for (var i=0;i<9;) //once per row
    {
        //parse that row to an int, then spit out a formatted string
        a += int.Parse(x.Substring(i*9,9)).ToString("\n║"+q(q(" 0 ","│"),"║")+"║\n") 
          // as well as a trailing row for the box
          + (i++<8?(i%3>0?"╟"+q(q("-","┼"),"╫")+"╢":"╠"+q(q("=","╪"),"╬")+"╣"):"╚"+q(q("=","╧"),"╩")+"╝");
    }
    //expand placeholder characters before returning
    return a.Replace("=","═══").Replace("-","───").Replace("0"," ");
}
```
[Try it online!](https://tio.run/##VY7bSgMxEIbv9ylCQEjcuoy2ta3brRTBO0Gs4E1v0jVKoJu1SaqVUhCfwIIiCKKoKB4ewafxRWrS1EPDJJPM/03@SfVSmis@6WshD1HrVBuexUEQpF2mNWoOg0AbZkSKtFGOMFybTs7UPkoQrpYBYKUEUFmB6aoBlOBnLUPFqkUoe@GfAlAFJy5X/irFVQvg@NfvOBf7aIsJSWgwDBBCx0yhjFtbyU9Qk9DYFTdyqfMuj/aUMJxkPNLkd0JqkVEwmQ2uyewyoMPNvkzr/lmYS41eQrKCpEkjC2U43bHzZQn@urrEYY/0CE5wwb6eMHXpGdPQpmscH@SKOFYkEIt6LaZDFiZCmmibKc3JIGr1O96FiMVaoUZptJu3fAG35dfVePY/AuQcLs@9w9g7jNvSXogIw3p1nYiFYgPWbflu1rQ0bfn0Le@@5QGv2fN@buw3T3x44hFTh9zMIS8eefXILabxSHHTVxKxaIcfdVnKf9ALH5j@CX6QMx//BbACcp9NRpNv "C# (.NET Core) – Try It Online")
# My Answer:
## [C# (.NET Core)](https://www.microsoft.com/net/core/platform), 509 430 418 bytes, 328 chars
```
string b(string x){var a="╔=╤=╤=╦=╤=╤=╦=╤=╤=╗\n║";for(int i=0,j=0,k,l,m;j<3;j++)for(k=0;k<3;k++){for(l=0;l<3;l++)for(m=0;m<3;)a+=" "+x[i++]+(m++<2?" │":" ║");a+=i<80?(k<2?"\n╟-┼-┼-╫-┼-┼-╫-┼-┼-╢\n║":"\n╠=╪=╪=╬=╪=╪=╬=╪=╪=╣\n║"):"\n╚=╧=╧=╩=╧=╧=╩=╧=╧=╝";}return a.Replace("=","═══").Replace("-","───").Replace("0"," ");}
```
### Ungolfed:
```
public string s(string x)
{
    var a = "╔=╤=╤=╦=╤=╤=╦=╤=╤=╗\n║";
    for (int i=0,j=0,k,l,m;j<3;j++)
    {
        for (k = 0; k < 3;k++)
        {
            for (l = 0; l < 3; l++)
            {
                for (m = 0; m < 3;)
                    a += " " + x[i++] + (m++ < 2 ? " │" : " ║");
            }
            a += i < 80 ? (k < 2 ? "\n╟-┼-┼-╫-┼-┼-╫-┼-┼-╢\n║": "\n╠=╪=╪=╬=╪=╪=╬=╪=╪=╣\n║") 
                        : "\n╚=╧=╧=╩=╧=╧=╩=╧=╧=╝";
        }
    }
    return a.Replace("=", "═══").Replace("-","───").Replace("0"," ");
}
I also looked at using a lambda for the `for` loops here, but it actually cost me one byte (saved 10 bytes per loop, with 41 bytes of overhead).
```
[Try it online!](https://tio.run/##dVDLThsxFN3PV1he2XISXfJoUpwRQqy7KYsuoAtncJEzr2psQqooUsUXFCkRUqUKBIiqwCfwNfMj4TozDWxi@WjOPefeuWcmss0oL/TqzJrslBz@sE6nMgiCKFHWkv1ZEFinnImIdYXvcNq6Ua6KExISOugBQLsL0G/D@nwE6ML/swN9dDvQq4x3DsAAvLnTf1M6H7CBys2@SW5OyCdlMsaDWUAImaiCpBrXZvqc7DMuvXiQZzZPdOtLYZxmqW6N2CYhx5Z5sKqDj1hNpnzmX6VCWi4XYbm8r/GwhV8dZ@XykspvecFM5ogJoTFGxI2kkcrxsCPHQnDvxiHIGOsY65kXEhQSFJK6IcU6xZorEVJCxfTICPFVsFSIYXuPknJxQXfxgeu4xB4zHMAei73nQ1w3y8VLheXTFn5bpd1dD9xg/Mcaz1v4XTXAq4nfqPyt8W8L/0PlvNDurMiIan3W3xMVaUZD2sAf@qu6lL8ZTW8sflb3vQFoEPzQ@Wq@egU "C# (.NET Core) – Try It Online")
[Answer]
# [Chip](https://github.com/Phlarx/chip), 3645 bytes
...that's not a typo...
```
ooooooZZ-)-K-)-K-)-K-)-K-)-K-)-K-)-K-)-K-)-K-)-K-)-K-).
|`xxxx-x--(x---x---x---x---x-v-x---x---x---x---x---x-.`K-)-K-)-K-)-K-).
|b|`xx-x--(x-v-x---x-v-x---x-x-x---x-v-x---x-v-x---x-x-x---x-v-x---x-.`K-).
|>xd`x-x(v-x-x-x-v-x-x-x-v-x-x-x-v-x-x-x-v-x-x-x-v-x-x-x-v-x-x-x-v-x-x-x-.|
||`--x-x-x(x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x/.
|`--z',/\',/\',/\',/\',/\',/\',/\',/\',/\',/\',/\',/\',/\',/\',/\',/\',/\','
`-. |,< >.| >.| >.| >.| >.| >.| >.| >.| >.| >.| >.| >.| >.| >.| >.| >.| >.|
*-x-/xZ/xZ^/xZ^/xZ^/xZ^/xZ^/xZ^/xZ^/xZ^/xZ^/xZ^/xZ^/xZ^/xZ^/xZ^/xZ^/xZ^/xZ'
Z~' |`'|`' |`' |`' |`' |`' |`' |`' |`' |`' |`' |`' |`' |`' |`' |`' |`','`'
    `)-K-)-K-)-K-)-K-)-K-)-K-)-K-)-K-)-K-)-K-)-K-)-K-)-K-)-K-)-K-)-K-)'
=
oooooo).h
`)))--^M^Zh
=
oooooo
|    `(--------------------------------------------------------------------------------------------------------va
KZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ^cg
)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx-xKZvvZ
xxxxxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxxx-Kxxxx}e
)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)x))xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)x))xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)x)b`feac
  c
=
oooooo
,'   `(--------------------------------------------------------------------------------------------------------.cba
KZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ^x^^)v--.
xx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxxx-xK-'f e`.
)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx-x-K-+Z+Z}e
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxK^}b gac
xxxxxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxxx-K^d
=
oooooo
,-'
KZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZtabgfv------.
)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx-xK^^x-Zv-vZ}e
xxxxxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxxxK^---^}cade,]b
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)-K----^-^^~'
,v'
db
=
oooooo
,--' `(--------------------------------------------------------------------------------------------------------v-.,-v-ZZZZZZZZZZZZf
KZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ'a{x.df
)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xx)xxKx-xxv+Zc
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)x-KZx+bge
xx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxxxxxxx---K\--^c
 a^b
=
oooooo
,---'`(--------------------------------------------------.
KZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ'gf
)xxxxx)xxxxx)xxxxx)xxxxx)xxxxx)xxxxx)xxxxx)xxxxx)xxxxx)xx-^KZc
)xxxxx)x)xxx)x)xxx)xxxxx)x)xxx)x)xxx)xxxxx)x)xxx)x)xxx)xxbahKZ\ZZZ
x))xxxxxxxxxxxxxxxx))xxxxxxxxxxxxxxxx))xxxxxxxxxxxxxxxx))-K-eh|fff
 ,--K-v-v-K--v-vK-v---K-----K-----K-----K-----K-----K `--Z-Z--'
A/ab/B/e/C/cd/D/-e/A
*}s
```
[Try it online!](https://tio.run/##xZdtb9sgEIC/36/wN0LjA/q2tNJWqdu@of0BlCH8GvfTJq1CaHP617Ozk6Z5WaU0btiZw/ZBgHDPHUnRPPxcLH70Ygxy1IergNYFEgyII1LcVo/7tk6F2x8n70ZajeN3Ph923l@z9@PSWHehdNQ28qs@x95FC23rVjONAg66ZLdZiL9ZKqfDlYFDkbTpx@ROtEMVzmiBMhgqdqAyME8saR2jkgzQlDkGCYl7E5D/UgafYIk3Fw04zjmi/WZNs7ZD2880wkjiM9AmqthiBjyEmAWDNt4bCFvCT/wcUHf1vDrw6/L36pO7usoKQrZYY5U8Qsp6sGwksESRx0crWMs9zQ2n9@62p4NGVieVE/HRprwyNmNDmIWDhL9Tn6DtPE9mBFr0sLLlS75MkcXG7DHLZ7VfYf4fcpm1AY1Hv@/zk@@97tKHnRdZWaXf88jEdUdoNz1a@8Qg9QzKfBMEZDEPThQpVZtc1LFBZNmfIMo6NoKaIAx@bAqI636KfBPG@ayKnt4R9ZTAozM1s9vIITsGOXE8KWzW@3u9xDfVaDV57fmVb9QHWfKs0WZKi4D@h8iOew6yUAhXTVvXNSS0e5oiyHdRTbfuGZcR/nqd0N8WQxcl/XuZ5fKzrOQXWZTyq8RK3sPZ/NdicXOtlLq4UmpyoXq5VepKPcu5mlDrpbpeNmy0KHWjusbzyYvl8gN1gL8 "Chip – Try It Online"), sort of. The TIO version contains a cutoff about a third of the way in (the `t` after the 4th `oooooo`), so that it should terminate in less than 60 seconds. The full version takes about 1m25s on my machine, and TIO seems about half as quick. This also means the TIO only shows the first 7 lines of output.
My first draft weighed in at a massive 19758 bytes, and took me about 8m30s to run. The final solution, pre-golfing, was a spry 5980 bytes, taking only 2m07s.
### So, how's it work, then?
This takes a string of 82 bytes, 81 digits, followed by a terminator. `\0` or `\n` or even another number will do. (This implementation actually only looks at the first 81, but requires at least one more, since Chip will terminate if it has exhausted its input. If this is unacceptable, the flag `-z` may be used, which effectively appends an infinite number of `\0` bytes to the end of the input.) The shortened TIO code doesn't actually get to all 81 bytes, so the point is moot there.
The way I've implemented this, it only looks at the low 4 bits of the input, so anything, really, can be a sudoku 'puzzle', from raw binary data, to the lesser-known works of Shakespeare. Any character whose low 4 bits are all zero will appear as a space (a special case), all other characters map into `123456789:;<=>?`. (So, the last few aren't digits, but neither is 10 a valid number in normal sudoku).
For the box-drawing characters, it produces UTF-8, equating to 3 bytes each.
### What about the actual implementation?
Chip is a 3D language that is inspired by integrated circuits. It has wires, logic gates, and memory cells. Most stuff is done on 2D planes, but these planes may be stacked atop one another. That is how this program is built.
The lines that start with `=` are the layer separators. Then, the layers are stacked, with the top and left sides aligned. The `o`'s serve as pins, allowing signals to pass from one layer to another.
Each layer here has a purpose, you could think of them as functions. The first layer controls everything; it 'calls' each of the other layers in turn. There is a repeating left-to-right pattern here. That pattern keeps track of which of the 19 lines of output we are currently printing.
The second layer is rather tiny, and it has a very tiny job. It sets the `0x80` bit for all the lines of output except the lines that contain numbers. `h` is the Chip element that corresponds to the `0x80` bit. (The low end of the alphabet `h` through `a` define all eight output bits.)
Layer three is where we really get into the meat of printing. This layer is in charge of line one. The ungolfed version has eight rows of `x`'s and `)`'s, mapping to 0's and 1's for each of the eight bits of each byte. However, we can take advantage of the patterns in the bits to accomplish the same task in fewer rows.
Layer four is much like the third. It handles the horizontal double lines.
Layer five handles the last line. Note that it is missing the wire along the top that the other layers have. This is because we don't need to return control to the sequencer. Instead, we can just terminate execution here with `t`.
Layer six handles the horizontal single lines.
Layer seven is where the numbers are printed. It is 'called' for each the nine numeric lines. It consumes 9 bytes of input as part of its execution.
[Answer]
# JavaScript (ES6), 222 bytes
Using short syntax for ES6 functions - 174 chars encoded in utf8, 222 bytes (<https://mothereff.in/byte-counter>). Using `function ...` requires 16 more bytes.
```
F=v=>[1,...v].map((x,i)=>'│║│'[i%3]+` ${x||' '} `+(i%9?'':`║
${[h,r,s,u,t]=i%27?'─╟╫┼╢':i>80?'═╚╩╧╝':i?'═╠╬╪╣':'═╔╦╤╗',r+(s=(u=(h+=h+h)+u+h+u+h)+s)+s+u+t}
`)).join``.slice(6)
```
*Less golfed*
```
F=v=>{
   // horizontal lines are appended after each 9th element
   // so I need to prepend a dummy first element to draw the top horizontal line
   v = [1, ...v];
   return v.map( (x,i) => 
     '│║│'[i % 3] + ` ${x||' '} ` // left bar and cell value
     + ( i % 9 ? '' // add horizontal line after each 9th element
       // the line drawing characters are chosen according to the value of i
       : `║\n${ [h, r, s, u, t] = 
         i % 27 != 0
         ? '─╟╫┼╢'
         : i > 80 
           ? '═╚╩╧╝' // i==81, bottom row
           : i != 0
             ? '═╠╬╪╣'
             : '═╔╦╤╗', // i==0, top row
         r + (s = (u = (h += h + h) + u + h + u + h) + s) + s + u + t
         }\n`
       )
   ).join``
   .slice(6) // cut the first cell (the dummy element)
}
```
```
F=v=>[1,...v].map((x,i)=>'│║│'[i%3]+` ${x||' '} `+(i%9?'':`║
${[h,r,s,u,t]=i%27?'─╟╫┼╢':i>80?'═╚╩╧╝':i?'═╠╬╪╣':'═╔╦╤╗',r+(s=(u=(h+=h+h)+u+h+u+h)+s)+s+u+t}
`)).join``.slice(6)
function go() {
  var i=I.value
  i = i.match(/\d+/g).map(x => +x); // convert strings to numbers
  O.textContent = F(i)
}
```
```
#I { width: 90% }
```
```
<input id=I value='8 5 0 0 0 2 4 0 0 7 2 0 0 0 0 0 0 9 0 0 4 0 0 0 0 0 0 0 0 0 1 0 7 0 0 2 3 0 5 0 0 0 9 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 8 0 0 7 0 0 1 7 0 0 0 0 0 0 0 0 0 0 3 6 0 4 0'>
<button onclick='go()'>go</button>
<pre id=O></pre>
```
[Answer]
# [Java (OpenJDK 8)](http://openjdk.java.net/), 279 bytes
```
String f(int[]a){String P="0121213121213121214",R[]={"╔═╤╦╗","║ │║║x","╟─┼╫╢","╠═╪╬╣","╚═╧╩╝"},r="";for(int X:P.getBytes()){for(int x:P.replace("1",R[X-=48].length()>5?"151":"111").getBytes())r+=R[X].charAt(x-48);r+="\n";}for(int i:a)r=r.replaceFirst("x",i>0?""+i:" ");return r;}
```
[Try it online!](https://tio.run/##hVHNattAEL77KYY57RJZWIncuBZKaA@5BUJyCbg6bJ21s6myNqt14iAEpU/QgpdCoTQkoaU/j9Cn2RdxVxvLGFKINGhmv5n5ZvTtBbti7cmUy4uzd8vp7G0uhjDMWVHAIRMSyuWJVkKOYUSE1IOM0XIFHKXYibbdu7PxjTE4HmRpidYsrPlozYM13635jIFDPoFdfHDO2dwD3@zivV38tea3NXceufVNv6z5Y829R7545Ic1P635ilWgUsRkNFH1OnDaPwrHXL@@0bwglJYNPne44tOcDTnBqN7ptJ3GvSzMuRzrc0L3uvsYdSPsYxRFSDdJ1FbqyrNweM7UK03m7bhHEwfiG4lJ1UwQfUZVqpopB0IVmqD7LbHX2UfcEn0EdH1cz5QElVRLgJW6hWbauauJOINLpzF5FHSQAVPjgkLZAvd49es0pCD5tT8TmvjcyU2h@WU4melw6lp1LkldGY5IXenvqYReAN0AOo1tBxA38a4/dp7YyyaI/5ddW9SQrJl3fNB9SgXBs2yP1tvYbT1l97kuN/fFeuGKruQBcK5qVa3lPw "Java (OpenJDK 8) – Try It Online")
For the byte count, use CP-437, [which is natively supported by Java](https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html) as `IBM437` (recent APIs) or `Cp437` (older APIs); so use a system that has this charset has this charset as default charset.
This code is compatible from Java 5 onwards, but was tested on Java 8 only.
### Explanation
```
String f(int[]a){
  String P="0121213121213121214",                         // Both lines and rows are repeated according to this pattern.
         R[]={"╔═╤╦╗","║ │║║x","╟─┼╫╢","╠═╪╬╣","╚═╧╩╝"},  // Characters found on each line.
                                                          //   (note the 'x')
         r="";                                            // The string under construction
  for (int X: P.getBytes()) {                             // For each line,
    for (int x:                                           //  For each character in the pattern,
         P.replace("1",R[X-=48].length()>5?"151":"111")   //    *but* with a cell width of 3,
                                                          //    and with an optional character ('x')
         .getBytes())
      r+=R[X].charAt(x-48);                               //   append the real mapped character
    r+="\n";                                              //  then append a new line
  }
  for(int i:a)                                            // For each number in the input
    r = r.replaceFirst("x",i>0?""+i:" ");                 //  replace the first 'x' with that number.
                                                          //    (or space if zero)
  return r;                                               // Return the constructed string.
}
```
[Answer]
# [Tcl](http://tcl.tk/), 373 bytes (273 chars)
Very naïve approach, but I just had to do it even it not being a winner by any measure:
```
puts ╔[set D ═══]╤$D╤$D╦$D╤$D╤$D╦$D╤$D╤$D╗
set r ║ 
lmap x $L {set r $r\ [expr $x?$x:{ }]\ [expr [incr i]%3?"│":"║"]
if ![expr $i%9] {puts $r\n[expr $i%27?"╟[set S ───]┼$S┼$S╫$S┼$S┼$S╫$S┼$S┼$S╢":$i<72?"╠$D╪$D╪$D╬$D╪$D╪$D╬$D╪$D╪$D╣":"╚$D╧$D╧$D╩$D╧$D╧$D╩$D╧$D╧$D╝"]
set r ║}}
```
[Try it online!](https://tio.run/##K0nO@V@cWqLgo1BtoWCqYACGRgomYNocyDJAgpZg0gRFDAINwaoheo2BpCmKDux6QNACag/EDHOsaowVzCAm1P4vKC0pVng0dUo0yMkuQNYECIp9NHWJiguUWAZnYeNO5wLpLQLqnajAlZObWKBQoaAC9D1EVKUoRiE6taIAyKqwV6mwqlaojYWJRGfmJRcpZMaqGtsrPZrSpGSlBDRDKZYrM01BEaonU9UyVqEa7EqgSXlwUSNzoJap88HODlZ4NKUBgmIfTdmjEgwhpq6GsbByFylZqWTamBuBzFkA8scqOLEGL3cx2J2zQMzlcGIlXu5coKfggVRb@/8/AA "Tcl – Try It Online")
---
Same chars expense but more bytes:
# [Tcl](http://tcl.tk/), 421 bytes (273 chars)
```
puts ╔[set D ═══]╤$D╤$D╦$D╤$D╤$D╦$D╤$D╤$D╗
set r ║ 
lmap x $L {set r $r\ [expr $x?$x:{ }]\ [expr [incr i]%3?"│":"║"]
if ![expr $i%9] {puts $r\n[expr $i%27?"╟───┼───┼───╫───┼───┼───╫───┼───┼───╢":$i<72?"╠$D╪$D╪$D╬$D╪$D╪$D╬$D╪$D╪$D╣":"╚$D╧$D╧$D╩$D╧$D╧$D╩$D╧$D╧$D╝"]
set r ║}}
```
[Try it online!](https://tio.run/##K0nO@V@cWqLgo1BtoWCqYACGRgomYNocyDJAgpZg0gRFDAINwaoheo2BpCmKDux6QNACag/EDHOsaowVzCAm1P4vKC0pVng0dUo0yMkuQNYECIp9NHWJiguUWAZnYeNO5wLpLQLqnajAlZObWKBQoaAC9D1EVKUoRiE6taIAyKqwV6mwqlaojYWJRGfmJRcpZMaqGtsrPZrSpGSlBDRDKZYrM01BEaonU9UyVqEa7EqgSXlwUSNzoJap8x9NaYChPdjZU1dTSc0iJSuVTBtzI5C9C0D@XgUn1uDlLgb7axaIuRxOrMTLnQsMBHig1tb@/w8A "Tcl – Try It Online")
[Answer]
# [SlimSharp](https://github.com/jcoehoorn/SlimSharp), 284 characters (bytes not counted)
```
S b(S x){S a="╔=╤=╤=╦=╤=╤=╦=╤=╤=╗\n║";for(I i=0,j=0,k,l,m;j<3;j++)for(k=0;k<3;k++){for(l=0;l<3;l++)for(m=0;m<3;)a+=" "+x[i++]+(m++<2?" │":" ║");a+=i<80?(k<2?"\n╟-┼-┼-╫-┼-┼-╫-┼-┼-╢\n║":"\n╠=╪=╪=╬=╪=╪=╬=╪=╪=╣\n║"):"\n╚=╧=╧=╩=╧=╧=╩=╧=╧=╝";}return a.R("=","═══").R("-","───").R("0"," ");}
```
This is a simple adaption of my C# answer.
]