Temporary Forum Oddities
#87
(06-24-2023, 04:45 PM)TerryRitchie Wrote: Is there any way to have code forum posts preserve all ASCII characters in the 32 to 255 range? For example, often times in my code I'll comment depictions of formulas as ASCII art in my code. I usually embed extended ASCII characters in them for readability. The code box below shows the result of this, versus the picture I included showing what it actually looks like.

Code: (Select All)
SUB Rotate (vec AS Type_Vector2, angleDeg AS SINGLE, origin AS Type_Vector2)
    ' Rotate a point around an origin using linear transformations.
    '
    '                                                       Rotating from (x,y) to (x',y')          |
    ' |                    (x',y')                            : L = R cosé                          | All of this shows how to get to this
    ' |                      ù                              : A = x'                              |                          -----------
    ' |                      /.\                              : B = L cosè = R cosè cosé = x cosé    |                                |
    ' |                    / .è\                            : (note - * opposite angles are equal) |                                |
    ' |                    /  .  \                            : C = R siné                          |                          +----+
    ' |                  /  .  \                          : D = C sinè = R sinè siné = y siné    |                          |
    ' |                  /    .    \                          : Y = R sinè                          |                          |
    ' |                /    .    \C                        : X = r cosè                          |                          
    ' |                /      .      \                                    __                          |                  -----------------
    ' |              /      .      \  L stops            : x' = B - |AB| = X cosé - Y siné      |                          
    ' |              /        .        \  here
    ' |            /        .        \  |                All of this just to show how to get from x to x' using      (X cosé - Y siné)
    ' |            /          .          \  |                Use the same linear transformation methods to get y' using  (X siné + Y cosé)
    ' |          R/          .          \ |
    ' |          /            .¿    D      \                Change the origin point of all rotations to (0,0) by subtracting the current
    ' |        /            .------------âù_--ù (x,y)      origin point from the current vector length. Add it back when rotation is
    ' |        /              .        __--.  .            completed.
    ' |      /              . *  __--    .  .
    ' |      /                . __--        .  .
    ' |    /            L __--            .  .
    ' |    /            __--  .            .  .Y
    ' |  /        __--    * .            .  .
    ' |  /      __--          .            .  .
    ' | / é __--              .            .  .
    ' |/__-- è              â.            .  .
    ' ù-----------------------ù-------------ù---ù------------
    '                        A            B
    ' |------------------- X -------------------|
    DIM x AS SINGLE
    DIM y AS SINGLE
    DIM __cos AS SINGLE
    DIM __sin AS SINGLE
    DIM xPrime AS SINGLE
    DIM yPrime AS SINGLE
    x = vec.x - origin.x '                move rotation vector origin to 0
    y = vec.y - origin.y
    __cos = COS(_D2R(angleDeg)) '        get cosine and sine of angle
    __sin = SIN(_D2R(angleDeg))
    xPrime = (x * __cos) - (y * __sin) '  calculate rotated location of vector
    yPrime = (x * __sin) + (y * __cos)
    xPrime = xPrime + origin.x '          move back to original origin
    yPrime = yPrime + origin.y
    vec.x = xPrime '                      pass back rotated vector
    vec.y = yPrime
END SUB

Unfortunately not with Forum codeboxes or Wiki examples.

Why?

Because the IDE uses ANSI codepages, hence to get all chars displayed correctly in the Forum/Wiki webpages it would require the extended ASCII chars (128-255) to be encoded as UTF-8. That's actually what is done when exporting to a HTML/RTF document, as those are usually not copied back to the IDE.

However, doing that for the Forum/Wiki exports would actually display those chars correctly in the browser, but if someone uses the 'Select all' button to copy and paste the examples back into the IDE these UTF chars are not converted back to the IDE codepage representation, i.e. the chars would then be wrong in the IDE and could lead to syntax errors.

As the intention of codeboxes/wiki examples is, that people can easily copy/paste the code to try it out, I've waived to the UTF-8 encoding here, but that causes the chars to be displayed wrong in the browser. However, when selected and copied back into the IDE they are right again.
Reply


Messages In This Thread
Temporary Forum Oddities - by admin - 06-04-2023, 05:04 AM
RE: Temporary Forum Oddities - by grymmjack - 06-04-2023, 05:21 AM
RE: Temporary Forum Oddities - by TerryRitchie - 06-04-2023, 02:19 PM
RE: Temporary Forum Oddities - by bplus - 06-04-2023, 03:23 PM
RE: Temporary Forum Oddities - by bplus - 06-04-2023, 03:56 PM
RE: Temporary Forum Oddities - by bplus - 06-04-2023, 04:05 PM
RE: Temporary Forum Oddities - by grymmjack - 06-04-2023, 04:31 PM
RE: Temporary Forum Oddities - by SMcNeill - 06-04-2023, 05:15 PM
RE: Temporary Forum Oddities - by bplus - 06-04-2023, 09:55 PM
RE: Temporary Forum Oddities - by bplus - 06-04-2023, 10:27 PM
RE: Temporary Forum Oddities - by grymmjack - 06-05-2023, 12:22 AM
RE: Temporary Forum Oddities - by bplus - 06-05-2023, 04:48 PM
RE: Temporary Forum Oddities - by mnrvovrfc - 06-05-2023, 08:28 PM
RE: Temporary Forum Oddities - by bplus - 06-05-2023, 09:06 PM
RE: Temporary Forum Oddities - by mnrvovrfc - 06-06-2023, 12:00 AM
RE: Temporary Forum Oddities - by SMcNeill - 06-06-2023, 12:10 AM
RE: Temporary Forum Oddities - by SMcNeill - 06-05-2023, 09:10 PM
RE: Temporary Forum Oddities - by grymmjack - 06-06-2023, 12:03 AM
RE: Temporary Forum Oddities - by TerryRitchie - 06-06-2023, 02:07 AM
RE: Temporary Forum Oddities - by grymmjack - 06-06-2023, 12:59 PM
RE: Temporary Forum Oddities - by bplus - 06-06-2023, 12:44 AM
RE: Temporary Forum Oddities - by SMcNeill - 06-06-2023, 05:07 PM
RE: Temporary Forum Oddities - by grymmjack - 06-08-2023, 10:08 PM
RE: Temporary Forum Oddities - by grymmjack - 06-08-2023, 10:06 PM
RE: Temporary Forum Oddities - by bplus - 06-09-2023, 01:11 PM
RE: Temporary Forum Oddities - by SMcNeill - 06-09-2023, 01:40 PM
RE: Temporary Forum Oddities - by bplus - 06-09-2023, 04:33 PM
RE: Temporary Forum Oddities - by TerryRitchie - 06-09-2023, 05:01 PM
RE: Temporary Forum Oddities - by TerryRitchie - 06-10-2023, 06:39 PM
RE: Temporary Forum Oddities - by SMcNeill - 06-10-2023, 06:49 PM
RE: Temporary Forum Oddities - by TerryRitchie - 06-10-2023, 07:02 PM
RE: Temporary Forum Oddities - by SMcNeill - 06-10-2023, 06:57 PM
RE: Temporary Forum Oddities - by SMcNeill - 06-10-2023, 07:14 PM
RE: Temporary Forum Oddities - by grymmjack - 06-10-2023, 07:43 PM
RE: Temporary Forum Oddities - by grymmjack - 06-10-2023, 08:23 PM
RE: Temporary Forum Oddities - by grymmjack - 06-10-2023, 08:25 PM
RE: Temporary Forum Oddities - by grymmjack - 06-10-2023, 08:26 PM
RE: Temporary Forum Oddities - by SMcNeill - 06-10-2023, 08:45 PM
RE: Temporary Forum Oddities - by bplus - 06-10-2023, 09:22 PM
RE: Temporary Forum Oddities - by SMcNeill - 06-10-2023, 09:30 PM
RE: Temporary Forum Oddities - by bplus - 06-10-2023, 09:32 PM
RE: Temporary Forum Oddities - by bplus - 06-10-2023, 09:53 PM
RE: Temporary Forum Oddities - by mnrvovrfc - 06-10-2023, 10:29 PM
RE: Temporary Forum Oddities - by Kernelpanic - 06-11-2023, 11:36 AM
RE: Temporary Forum Oddities - by SMcNeill - 06-11-2023, 11:41 AM
RE: Temporary Forum Oddities - by mnrvovrfc - 06-11-2023, 04:54 PM
RE: Temporary Forum Oddities - by grymmjack - 06-17-2023, 01:46 PM
RE: Temporary Forum Oddities - by mnrvovrfc - 06-23-2023, 01:03 AM
RE: Temporary Forum Oddities - by grymmjack - 06-11-2023, 02:40 PM
RE: Temporary Forum Oddities - by grymmjack - 06-11-2023, 02:51 PM
RE: Temporary Forum Oddities - by bplus - 06-11-2023, 03:11 PM
RE: Temporary Forum Oddities - by grymmjack - 06-11-2023, 03:29 PM
RE: Temporary Forum Oddities - by grymmjack - 06-11-2023, 03:26 PM
RE: Temporary Forum Oddities - by bplus - 06-11-2023, 03:26 PM
RE: Temporary Forum Oddities - by grymmjack - 06-11-2023, 03:49 PM
RE: Temporary Forum Oddities - by bplus - 06-11-2023, 03:40 PM
RE: Temporary Forum Oddities - by bplus - 06-11-2023, 04:40 PM
RE: Temporary Forum Oddities - by Kernelpanic - 06-11-2023, 04:57 PM
RE: Temporary Forum Oddities - by grymmjack - 06-12-2023, 12:35 AM
RE: Temporary Forum Oddities - by grymmjack - 06-13-2023, 12:24 PM
RE: Temporary Forum Oddities - by SMcNeill - 06-13-2023, 01:09 PM
RE: Temporary Forum Oddities - by bplus - 06-13-2023, 03:33 PM
RE: Temporary Forum Oddities - by Kernelpanic - 06-13-2023, 08:04 PM
RE: Temporary Forum Oddities - by SMcNeill - 06-13-2023, 10:03 PM
RE: Temporary Forum Oddities - by grymmjack - 06-17-2023, 01:54 PM
RE: Temporary Forum Oddities - by TerryRitchie - 06-22-2023, 01:05 PM
RE: Temporary Forum Oddities - by bplus - 06-22-2023, 02:12 PM
RE: Temporary Forum Oddities - by TerryRitchie - 06-22-2023, 03:23 PM
RE: Temporary Forum Oddities - by RhoSigma - 06-22-2023, 02:37 PM
RE: Temporary Forum Oddities - by bplus - 06-22-2023, 03:18 PM
RE: Temporary Forum Oddities - by TerryRitchie - 06-22-2023, 03:25 PM
RE: Temporary Forum Oddities - by RhoSigma - 06-22-2023, 04:05 PM
RE: Temporary Forum Oddities - by TerryRitchie - 06-22-2023, 03:37 PM
RE: Temporary Forum Oddities - by bplus - 06-22-2023, 03:39 PM
RE: Temporary Forum Oddities - by TerryRitchie - 06-22-2023, 03:41 PM
RE: Temporary Forum Oddities - by RhoSigma - 06-22-2023, 05:01 PM
RE: Temporary Forum Oddities - by TerryRitchie - 06-22-2023, 11:39 PM
RE: Temporary Forum Oddities - by RhoSigma - 06-23-2023, 06:55 AM
RE: Temporary Forum Oddities - by TerryRitchie - 06-23-2023, 01:41 PM
RE: Temporary Forum Oddities - by RhoSigma - 06-23-2023, 04:13 PM
RE: Temporary Forum Oddities - by bplus - 06-22-2023, 03:44 PM
RE: Temporary Forum Oddities - by TerryRitchie - 06-22-2023, 03:49 PM
RE: Temporary Forum Oddities - by bplus - 06-22-2023, 05:40 PM
RE: Temporary Forum Oddities - by grymmjack - 06-24-2023, 02:53 PM
RE: Temporary Forum Oddities - by bplus - 06-24-2023, 03:17 PM
RE: Temporary Forum Oddities - by RhoSigma - 06-24-2023, 07:34 PM
RE: Temporary Forum Oddities - by bplus - 06-24-2023, 09:29 PM
RE: Temporary Forum Oddities - by RhoSigma - 06-24-2023, 10:02 PM
RE: Temporary Forum Oddities - by TerryRitchie - 06-24-2023, 04:45 PM
RE: Temporary Forum Oddities - by RhoSigma - 06-24-2023, 07:32 PM
RE: Temporary Forum Oddities - by bplus - 06-25-2023, 01:29 AM
RE: Temporary Forum Oddities - by RhoSigma - 06-25-2023, 07:35 AM
RE: Temporary Forum Oddities - by mnrvovrfc - 06-25-2023, 02:42 AM
RE: Temporary Forum Oddities - by RhoSigma - 06-25-2023, 07:44 AM



Users browsing this thread: 43 Guest(s)