<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to Decode a Base64 Encoded Bookmark in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/How-to-Decode-a-Base64-Encoded-Bookmark/m-p/3329701#M43444</link>
    <description>&lt;P&gt;Did you ever get a solution to this? I am also trying to decode the bookmark state, but unable to get anything other than gibberish as well.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jul 2023 15:04:15 GMT</pubDate>
    <dc:creator>ozpbi123</dc:creator>
    <dc:date>2023-07-13T15:04:15Z</dc:date>
    <item>
      <title>How to Decode a Base64 Encoded Bookmark</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-Decode-a-Base64-Encoded-Bookmark/m-p/2954497#M40180</link>
      <description>&lt;P&gt;I am using this library,&amp;nbsp;&lt;A href="https://github.com/microsoft/PowerBI-JavaScript," target="_blank" rel="noopener"&gt;https://github.com/microsoft/PowerBI-JavaScript,&lt;/A&gt;&amp;nbsp;to embed reports and handle bookmarks. I am calling capture() from the bookmarksManager object on my report. This returns a bookmark with the state. The state is a base64 encoded string. I am trying to decode the string for testing purposes, but I can't get it to decode correctly. I have used Mime tools in Notepad++ and various online decoders, but they all return gibberish.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a trick to decoding base64 encoded bookmark states?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 15:43:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-Decode-a-Base64-Encoded-Bookmark/m-p/2954497#M40180</guid>
      <dc:creator>Log4TurtleShell</dc:creator>
      <dc:date>2022-12-07T15:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to Decode a Base64 Encoded Bookmark</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-Decode-a-Base64-Encoded-Bookmark/m-p/2955684#M40192</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/451991"&gt;@Log4TurtleShell&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please review the following links, hope they can help you.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/2820249/base64-encoding-and-decoding-in-client-side-javascript" target="_self"&gt;Base64 encoding and decoding in client-side Javascript&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.jeffryhouser.com/index.cfm/2022/5/31/How-do-I-decode-a-Base64-encoded-string-in-JavaScript" target="_self"&gt;How do I decode a Base64 encoded string in JavaScript?&lt;/A&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;console.log(atob('TXkgU3RyaW5nIFRvIEVuY29kZQ=='));&lt;/LI-CODE&gt;
&lt;P&gt;&lt;A href="https://futurestud.io/tutorials/how-to-base64-encode-decode-a-value-in-node-js" target="_self"&gt;Base64 Decode a Value in Node.js&lt;/A&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;const plain = Buffer.from('dXNlcm5hbWU6cGFzc3dvcmQ=', 'base64').toString('utf8')  &lt;/LI-CODE&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 06:02:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-Decode-a-Base64-Encoded-Bookmark/m-p/2955684#M40192</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-08T06:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to Decode a Base64 Encoded Bookmark</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-Decode-a-Base64-Encoded-Bookmark/m-p/2957314#M40205</link>
      <description>&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using atob() still returns gibberish. Am I wrong that the bookmark state should be able to be decoded to readable text?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 16:54:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-Decode-a-Base64-Encoded-Bookmark/m-p/2957314#M40205</guid>
      <dc:creator>Log4TurtleShell</dc:creator>
      <dc:date>2022-12-08T16:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to Decode a Base64 Encoded Bookmark</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-Decode-a-Base64-Encoded-Bookmark/m-p/3329701#M43444</link>
      <description>&lt;P&gt;Did you ever get a solution to this? I am also trying to decode the bookmark state, but unable to get anything other than gibberish as well.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 15:04:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-Decode-a-Base64-Encoded-Bookmark/m-p/3329701#M43444</guid>
      <dc:creator>ozpbi123</dc:creator>
      <dc:date>2023-07-13T15:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to Decode a Base64 Encoded Bookmark</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-Decode-a-Base64-Encoded-Bookmark/m-p/3329714#M43445</link>
      <description>&lt;P&gt;Unfortunately, I did not. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 15:09:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-Decode-a-Base64-Encoded-Bookmark/m-p/3329714#M43445</guid>
      <dc:creator>Log4TurtleShell</dc:creator>
      <dc:date>2023-07-13T15:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to Decode a Base64 Encoded Bookmark</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-Decode-a-Base64-Encoded-Bookmark/m-p/3745903#M50129</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/451991"&gt;@Log4TurtleShell&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/588082"&gt;@ozpbi123&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The state of bookmarks is gzipped, so after you decoded it from base64 you need to decompress it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;static class Program
{
    public static void Main()
    {
        // Replace with your actual Base64-encoded and gzipped string
        string encodedAndGzippedString = "";

        // Decode the Base64 string
        byte[] decodedBytes = Convert.FromBase64String(encodedAndGzippedString);

        // Decompress the gzipped data
        string decompressedString = DecompressGzip(decodedBytes);

        Console.WriteLine("Decompressed data:");
        Console.WriteLine(decompressedString);
    }

    public static string DecompressGzip(byte[] compressedData)
    {
        using (var memoryStream = new MemoryStream(compressedData))
        using (var gzipStream = new GZipStream(memoryStream, CompressionMode.Decompress))
        using (var reader = new StreamReader(gzipStream, Encoding.UTF8))
        {
            return reader.ReadToEnd();
        }
    }

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 06 Mar 2024 11:38:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-Decode-a-Base64-Encoded-Bookmark/m-p/3745903#M50129</guid>
      <dc:creator>klirium</dc:creator>
      <dc:date>2024-03-06T11:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to Decode a Base64 Encoded Bookmark</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-Decode-a-Base64-Encoded-Bookmark/m-p/3887980#M52145</link>
      <description>&lt;P&gt;Great post&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/701263"&gt;@klirium&lt;/a&gt;&amp;nbsp; - we've been struggling with trying to find a way to interpret saved bookmarks to handle updates when a change is made to a report and then the previous saved bookmarks become partially invalid.&amp;nbsp; I haven't tested your code, but I was able to verify the concept of base64 and decompress does work.&amp;nbsp; This site gives a nice way to plug in individual encoded bookmarks and see the plaintext&amp;nbsp;&amp;nbsp;&lt;A href="https://www.zickty.com/gziptotext" target="_blank"&gt;https://www.zickty.com/gziptotext&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2024 06:27:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-Decode-a-Base64-Encoded-Bookmark/m-p/3887980#M52145</guid>
      <dc:creator>SitiV</dc:creator>
      <dc:date>2024-05-03T06:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to Decode a Base64 Encoded Bookmark</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-Decode-a-Base64-Encoded-Bookmark/m-p/4353697#M58917</link>
      <description>&lt;P&gt;I did.&lt;BR /&gt;You can use below python script to decode the bookmark State.&lt;BR /&gt;The output is a JSON. Hope this helps.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Base64 Decode&lt;/STRONG&gt;: Convert the Base64-encoded string back to its binary form.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Gzip Decompress&lt;/STRONG&gt;: Decompress the binary data to get the original string.&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="python"&gt;import base64
import gzip
from io import BytesIO

def decode_base64_gzip(encoded_string):
    # Step 1: Base64 decode
    decoded_data = base64.b64decode(encoded_string)
    
    # Step 2: Gzip decompress
    with gzip.GzipFile(fileobj=BytesIO(decoded_data)) as gzip_file:
        decompressed_data = gzip_file.read()
    
    return decompressed_data.decode('utf-8')

# Example usage
encoded_string = "your_base64_gzipped_string_here"
decoded_string = decode_base64_gzip(encoded_string)
print(decoded_string)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 15:57:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-Decode-a-Base64-Encoded-Bookmark/m-p/4353697#M58917</guid>
      <dc:creator>Hettic1</dc:creator>
      <dc:date>2025-01-07T15:57:21Z</dc:date>
    </item>
  </channel>
</rss>

