<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Neeraj Verma</title>
    <description>The latest articles on DEV Community by Neeraj Verma (@vermaneerajin).</description>
    <link>https://dev.to/vermaneerajin</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F200083%2F3bf42f87-0d73-42a9-a5ee-85abb27b5275.jpg</url>
      <title>DEV Community: Neeraj Verma</title>
      <link>https://dev.to/vermaneerajin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vermaneerajin"/>
    <language>en</language>
    <item>
      <title>JWT 101: The Go Developer's Guide to Secure Authentication</title>
      <dc:creator>Neeraj Verma</dc:creator>
      <pubDate>Sun, 08 Feb 2026 09:24:00 +0000</pubDate>
      <link>https://dev.to/vermaneerajin/jwt-101-the-go-developers-guide-to-secure-authentication-50p1</link>
      <guid>https://dev.to/vermaneerajin/jwt-101-the-go-developers-guide-to-secure-authentication-50p1</guid>
      <description>&lt;p&gt;In the world of modern web development, &lt;strong&gt;JSON Web Tokens (JWT)&lt;/strong&gt; have become the gold standard for handling authentication and secure data exchange. But what exactly happens when a server issues a token? Is it encrypted? Can anyone read it?&lt;/p&gt;

&lt;p&gt;This guide breaks down the mechanics of JWTs, clarifies the common confusion between “encoding” and “encryption,” and shows you how to implement them in &lt;strong&gt;Go (Golang)&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Mechanics: How JWT Works
&lt;/h2&gt;

&lt;p&gt;A JWT is a compact, URL-safe means of representing claims to be transferred between two parties. Unlike traditional session-based authentication where the server keeps a record of logged-in users (stateful), JWTs are &lt;strong&gt;stateless&lt;/strong&gt;. The token itself contains all the necessary information to verify the user.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The Anatomy of a Token
&lt;/h3&gt;

&lt;p&gt;If you look at a JWT, it appears as a long string of random characters separated by two dots. It follows this structure:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Header.Payload.Signature&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Header:&lt;/strong&gt; Indicates the algorithm used (e.g., &lt;code&gt;HS256&lt;/code&gt;) and the token type (&lt;code&gt;JWT&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Payload:&lt;/strong&gt; Contains the “Claims” (user data like ID, role, expiration time).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Signature:&lt;/strong&gt; The security seal.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  2. Secrecy vs. Integrity
&lt;/h3&gt;

&lt;p&gt;A common question developers ask is: &lt;em&gt;“If the token is just Base64 encoded, can’t anyone read the signature and the payload?”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The answer is &lt;strong&gt;yes&lt;/strong&gt;. Anyone who intercepts the token can decode and read the payload. However, the security of a JWT doesn’t come from hiding the data; it comes from ensuring the data &lt;strong&gt;hasn’t been changed&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  The “Wax Seal” Analogy
&lt;/h4&gt;

&lt;p&gt;Think of a JWT like a letter sent by a King (the Server) to a Messenger (the Client).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Payload:&lt;/strong&gt; The content of the letter (“Give this messenger 10 gold coins”).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Signature:&lt;/strong&gt; The King’s &lt;strong&gt;wax seal&lt;/strong&gt; stamped at the bottom.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Anyone can &lt;em&gt;see&lt;/em&gt; the wax seal. It isn’t hidden. But no one can &lt;em&gt;copy&lt;/em&gt; or &lt;em&gt;forge&lt;/em&gt; the seal because they don’t have the King’s signet ring (the &lt;strong&gt;Secret Key&lt;/strong&gt; ).&lt;/p&gt;

&lt;p&gt;If a thief changes the letter to say “Give this messenger &lt;strong&gt;10,000&lt;/strong&gt; gold coins,” the wax seal will no longer match the content. They cannot “re-seal” the letter because they lack the King’s ring.&lt;/p&gt;

&lt;h4&gt;
  
  
  The Technical Reality: Encoding vs. Encryption
&lt;/h4&gt;

&lt;p&gt;The signature is &lt;strong&gt;not plain text&lt;/strong&gt; , nor is it encrypted. It is a &lt;strong&gt;binary cryptographic hash&lt;/strong&gt; that is Base64Url encoded.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Math:&lt;/strong&gt; The server takes the Header and Payload and runs them through a hashing algorithm (like HMAC-SHA256) using a Secret Key.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Encoding:&lt;/strong&gt; The output of this hash is raw binary data (bytes). To make it safe for URLs and HTTP headers, we &lt;strong&gt;Base64Url Encode&lt;/strong&gt; these bytes into text characters (&lt;code&gt;A-Z&lt;/code&gt;, &lt;code&gt;0-9&lt;/code&gt;, &lt;code&gt;-&lt;/code&gt;, &lt;code&gt;_&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This ensures that even though anyone can &lt;em&gt;read&lt;/em&gt; the token, no one can &lt;em&gt;generate&lt;/em&gt; a valid signature for a fake payload without your server’s secret key.&lt;/p&gt;




&lt;h2&gt;
  
  
  Implementing JWT in Golang
&lt;/h2&gt;

&lt;p&gt;Let’s look at how to implement this using the industry-standard package &lt;code&gt;github.com/golang-jwt/jwt/v5&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Define Your Claims
&lt;/h3&gt;

&lt;p&gt;First, we define what data we want to store inside the token.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import (
    "github.com/golang-jwt/jwt/v5"
    "time"
)

// Define a custom struct to hold the token claims
type UserClaims struct {
    UserID string `json:"user_id"`
    Role string `json:"role"`
    jwt.RegisteredClaims // Embed standard claims (exp, iss, etc.)
}

// In production, keep this safe! Never hardcode it in your source code.
var jwtKey = []byte("my_secret_key")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Generating a Token (Login)
&lt;/h3&gt;

&lt;p&gt;When a user logs in successfully, we generate the token. Notice how we “sign” it at the end—this is where the hashing happens.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func GenerateToken(userID, role string) (string, error) {
    // 1. Create the Claims
    claims := UserClaims{
        UserID: userID,
        Role: role,
        RegisteredClaims: jwt.RegisteredClaims{
            ExpiresAt: jwt.NewNumericDate(time.Now().Add(15 * time.Minute)), // Short expiry!
            Issuer: "my-app",
        },
    }

    // 2. Create the token using the HS256 algorithm
    token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)

    // 3. Sign the token with our secret key
    // This generates the binary hash and Base64 encodes it for you
    signedToken, err := token.SignedString(jwtKey)
    if err != nil {
        return "", err
    }

    return signedToken, nil
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Validating the Token (Middleware)
&lt;/h3&gt;

&lt;p&gt;When the server receives a token, it doesn’t “decrypt” it. Instead, it re-calculates the hash using the &lt;code&gt;jwtKey&lt;/code&gt; to see if it matches the signature provided.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func VerifyToken(tokenString string) (*UserClaims, error) {
    // Parse the token
    token, err := jwt.ParseWithClaims(tokenString, &amp;amp;UserClaims{}, func(token *jwt.Token) (interface{}, error) {
        // Validate the alg is what you expect (Crucial security step!)
        if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok {
            return nil, fmt.Errorf("unexpected signing method: %v", token.Header["alg"])
        }
        return jwtKey, nil
    })

    if err != nil {
        return nil, err
    }

    // Check if the token is valid (signature match) and not expired
    if claims, ok := token.Claims.(*UserClaims); ok &amp;amp;&amp;amp; token.Valid {
        return claims, nil
    }

    return nil, fmt.Errorf("invalid token")
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  When Should You Use JWT?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Authorization &amp;amp; Single Sign-On (SSO)
&lt;/h3&gt;

&lt;p&gt;This is the most common use case. Because JWTs are self-contained, they are easily passed between different domains (e.g., &lt;code&gt;auth.example.com&lt;/code&gt; and &lt;code&gt;app.example.com&lt;/code&gt;), making them perfect for SSO.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Secure Information Exchange
&lt;/h3&gt;

&lt;p&gt;Because the tokens are signed, the receiver can be 100% sure that the sender is who they claim to be. If the signature matches, the data is authentic.&lt;/p&gt;




&lt;h2&gt;
  
  
  Pros and Cons of JWT
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Pros
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Stateless Scalability:&lt;/strong&gt; The server doesn’t need to store session info, making it trivial to scale across multiple servers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mobile Friendly:&lt;/strong&gt; Native mobile apps handle JSON and headers much easier than cookies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance:&lt;/strong&gt; No database lookup is required to verify the token (only to check revocation lists if you use them).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Cons &amp;amp; Security Considerations
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Payload Visibility:&lt;/strong&gt; &lt;strong&gt;Never put passwords or sensitive personal data (PII) in the payload.&lt;/strong&gt; Remember, anyone can base64 decode it and read it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Revocation Difficulty:&lt;/strong&gt; You cannot “log out” a user instantly by deleting a server session.

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Solution:&lt;/em&gt; Use &lt;strong&gt;Short-Lived Access Tokens&lt;/strong&gt; (e.g., 15 mins) paired with &lt;strong&gt;Refresh Tokens&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Storage Matters:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;LocalStorage:&lt;/strong&gt; Vulnerable to XSS (Cross-Site Scripting).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HttpOnly Cookies:&lt;/strong&gt; Vulnerable to CSRF, but safer against XSS. &lt;strong&gt;Recommended for web apps.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;JWTs offer a modern, lightweight approach to authentication. The key takeaway is that they guarantee &lt;strong&gt;integrity&lt;/strong&gt; , not &lt;strong&gt;secrecy&lt;/strong&gt;. The signature ensures that the data you receive is exactly what was sent, signed by a trusted party. By understanding this distinction, you can build secure, scalable Go applications without falling into common security traps.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>go</category>
      <category>security</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>UTF-8: The Universal Language of the Digital World</title>
      <dc:creator>Neeraj Verma</dc:creator>
      <pubDate>Sun, 05 Oct 2025 08:50:00 +0000</pubDate>
      <link>https://dev.to/vermaneerajin/utf-8-the-universal-language-of-the-digital-world-kck</link>
      <guid>https://dev.to/vermaneerajin/utf-8-the-universal-language-of-the-digital-world-kck</guid>
      <description>&lt;p&gt;The modern internet, filled with languages, symbols, and emojis, relies on an ingenious, invisible system to ensure text looks the same whether you view it in New York, Tokyo, or Madrid. That system is the partnership between &lt;strong&gt;Unicode&lt;/strong&gt; and &lt;strong&gt;UTF-8&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This post will trace the evolution of character encoding, explaining why older systems failed and how UTF-8 rose to become the dominant, future-proof solution for global communication.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Fundamental Problem of Encoding
&lt;/h3&gt;

&lt;p&gt;Before diving into Unicode, we must understand the core challenge: &lt;strong&gt;Character Encoding&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Computers fundamentally only understand &lt;strong&gt;bits&lt;/strong&gt; —sequences of 1s and 0s. Character encoding is the necessary process of transforming human-readable strings (text) into these bits so the computer can process, store, and transmit them.&lt;/p&gt;

&lt;p&gt;We can look at a simpler, pre-computer example: &lt;strong&gt;Morse code&lt;/strong&gt;. Invented around 1837, Morse code used only two symbols (short and long signals) to encode the entire English alphabet (e.g., A is .- and E is .).&lt;/p&gt;

&lt;p&gt;With computers, this process became automatized. The general flow for data exchange is always:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    Message -&amp;gt; Encoding -&amp;gt; Store/Send -&amp;gt; Decoding -&amp;gt; Message

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The Failure of Early Standards (ASCII)
&lt;/h3&gt;

&lt;p&gt;To automate encoding in the early days of computing, standardized methods were required.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Introduction of ASCII (1963)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;One of the early standards created around &lt;strong&gt;1963&lt;/strong&gt; was &lt;strong&gt;ASCII&lt;/strong&gt; (American Standard Code for Information Interchange). ASCII worked by associating each character with a decimal number, which was then converted into binary. For example, the letter ‘A’ is 65 in ASCII, stored as 1000001 (or 01000001 in an 8-bit system).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Incompatibility Crisis&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The major limitation of ASCII was its size: it only covered &lt;strong&gt;127 or 128 characters&lt;/strong&gt; (primarily the English alphabet and common symbols). . Because of this limitation, ASCII had a &lt;strong&gt;problem&lt;/strong&gt; if non-English characters, like the French ‘ç’ or the Japanese ‘大’, needed to be added. In response, people created their own &lt;strong&gt;extended encoding systems&lt;/strong&gt; throughout the late 1960s to the 1980s. This fragmentation resulted in severe &lt;strong&gt;compatibility issues&lt;/strong&gt;. When a file encoded with one system was interpreted using the wrong encoding system, the result was incomprehensible text, or “jibberish”&lt;/p&gt;

&lt;h3&gt;
  
  
  Unicode — The Universal Character Set (1991)
&lt;/h3&gt;

&lt;p&gt;After years of struggling with incompatible encodings, a new standard was developed to unify character representation: &lt;strong&gt;Unicode&lt;/strong&gt; , introduced in &lt;strong&gt;1991&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Goal:&lt;/strong&gt; Unicode’s objective is to provide a &lt;strong&gt;unique number, called a code point, for every character&lt;/strong&gt; , regardless of the platform, program, or language. This standardized approach made Unicode “the Rosetta Stone of Characters”.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Scope:&lt;/strong&gt; Unicode currently defines over &lt;strong&gt;137,000&lt;/strong&gt; characters. This vast set includes:

&lt;ul&gt;
&lt;li&gt;Non-Latin scripts (e.g., Chinese, Arabic, Japanese, Cyrillic).&lt;/li&gt;
&lt;li&gt;Symbols, mathematical notation, and currency signs.&lt;/li&gt;
&lt;li&gt;A wide range of &lt;strong&gt;emojis&lt;/strong&gt; (e.g., 😀) and historical scripts.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Definition vs. Encoding:&lt;/strong&gt; It is important to remember that Unicode defines the character and assigns its code point; it does not dictate how that code point is stored. That task belongs to the encoding system.&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  UTF-8 — The Dominant Encoding (1993)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;UTF-8&lt;/strong&gt; (Unicode Transformation Format) was created in &lt;strong&gt;1993&lt;/strong&gt; to efficiently store and transmit Unicode code points. It quickly gained popularity, becoming the &lt;strong&gt;dominant character encoding on the web by 1996&lt;/strong&gt;. Today, &lt;strong&gt;more than 94% of websites use UTF-8&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The Key Advantages of UTF-8&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Backward Compatibility with ASCII:&lt;/strong&gt; This is a major reason for its success. The first 127 characters (the ASCII range) are encoded identically in UTF-8 and only require &lt;strong&gt;1 byte&lt;/strong&gt;. This means that older ASCII systems can still handle basic English text that is encoded in UTF-8.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Efficient Variable-Width Encoding:&lt;/strong&gt; UTF-8 uses a variable-width scheme, meaning a character can take from &lt;strong&gt;1 to 4 bytes&lt;/strong&gt;. This optimizes storage because the most frequently used characters (Latin alphabet) use the fewest bytes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Future-Proof Capacity:&lt;/strong&gt; UTF-8 is designed to handle all existing and future Unicode values. The 4-byte template provides &lt;strong&gt;21 available slots&lt;/strong&gt; for bits, allowing it to store up to 2,097,152 values. This far exceeds the current capacity of the Unicode standard (around 1.1 million), ensuring that you &lt;strong&gt;won’t need to switch to another encoding system in the future&lt;/strong&gt; to allocate new characters.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Robustness:&lt;/strong&gt; UTF-8 is considered robust because it is &lt;strong&gt;self-synchronizing&lt;/strong&gt; , which makes error detection and recovery easier during transmission or storage.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;How the Variable-Width Encoding Works&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;UTF-8 uses byte templates to signal how many bytes a character occupies, depending on the code point’s value.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Byte Count&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Code Point Range&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Template Structure Start&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Notes&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;1 Byte&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Up to &lt;strong&gt;127&lt;/strong&gt; ( &lt;strong&gt;ASCII&lt;/strong&gt; )&lt;/td&gt;
&lt;td&gt;Always starts with &lt;code&gt;0&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Used for basic English characters.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;2 Bytes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Up to &lt;strong&gt;2047&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Starts with &lt;code&gt;110&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Used for many European characters (e.g., ‘À’).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;3 Bytes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Beyond &lt;strong&gt;2047&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Starts with &lt;code&gt;1110&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Used when 11 bits are insufficient.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4 Bytes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Up to &lt;strong&gt;21 bits&lt;/strong&gt; of value&lt;/td&gt;
&lt;td&gt;Starts with &lt;code&gt;11110&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Necessary for high-value characters like complex emojis (e.g., 🙂, which has 17 bits).&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Handling Complex Unicode Characters
&lt;/h3&gt;

&lt;p&gt;Unicode and UTF-8 also define how visually complex characters are represented digitally, often combining multiple unique code points into a single graphical unit.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Composite Emojis (Skin Tones):&lt;/strong&gt; Some emojis that feature skin tone variations (e.g., ‘🖖🏾’) are represented internally in Unicode as &lt;strong&gt;a combination of two separate characters&lt;/strong&gt;. When the computer sees these two characters placed together, it renders them as a single emoji with the skin tone applied.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flag Emojis:&lt;/strong&gt; Similarly, flag emojis (e.g., ‘🇦🇺’) are represented by a combination of two distinct abstract Unicode characters called “Regional Indicator Symbols”. When placed next to each other, the computer interprets the combination and displays the corresponding flag.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;When working with any kind of text, it is crucial to remember that it is always tied to an associated encoding system. UTF-8’s ingenious design—combining efficiency, total Unicode coverage, and crucial backward compatibility with ASCII—has made it the essential standard for modern digital life. It is advisable to use modern encoding systems like UTF-8 to ensure maximum compatibility and avoid the need for future format switches.&lt;/p&gt;

&lt;h3&gt;
  
  
  Watch on youtube 👇
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=HBprQUigQuo" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6rxro0yblj7uylktv74o.jpg" alt="Watch the video" width="640" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>computerscience</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Deploy static site using netlify and zola</title>
      <dc:creator>Neeraj Verma</dc:creator>
      <pubDate>Sun, 19 May 2024 09:24:00 +0000</pubDate>
      <link>https://dev.to/vermaneerajin/deploy-static-site-using-netlify-and-zola-502m</link>
      <guid>https://dev.to/vermaneerajin/deploy-static-site-using-netlify-and-zola-502m</guid>
      <description>&lt;p&gt;Netlify is a popular platform for hosting static sites, and it integrates seamlessly with Zola, a fast and user-friendly static site generator. This article will guide you through deploying your Zola site to Netlify, giving you a quick and easy way to share your creation with the world.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up Your Zola Project
&lt;/h2&gt;

&lt;p&gt;Before diving into Netlify, ensure you have a Zola project ready. If you’re new to Zola, head over to their official &lt;a href="https://www.getzola.org/documentation/" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; to get started with creating a new project and populating it with content.&lt;/p&gt;

&lt;h3&gt;
  
  
  Initializing and setting up site in local
&lt;/h3&gt;

&lt;p&gt;To initialize the site in local you can run the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ zola init local-site

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The initializer command will ask few question. Configure these as per your requirement.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; What is the URL of your site? (https://example.com):
&amp;gt; Do you want to enable Sass compilation? [Y/n]:
&amp;gt; Do you want to enable syntax highlighting? [y/N]:
&amp;gt; Do you want to build a search index of the content? [y/N]:

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once inside the project directory &lt;code&gt;cd local-site&lt;/code&gt;. Run the following command to build and run your site in local.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ zola build
$ zola serve

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output of above command would be like below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Building site...
Checking all internal links with anchors.
&amp;gt; Successfully checked 0 internal link(s) with anchors.
-&amp;gt; Creating 0 pages (0 orphan) and 0 sections
Done in 16ms.

Listening for changes in /home/&amp;lt;username&amp;gt;/&amp;lt;project&amp;gt;/local-site/{config.toml,content,sass,static,templates}
Press Ctrl+C to stop

Web server is available at http://127.0.0.1:1025

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If everything went well. You will be able to access your static site on the above mentioned address i.e &lt;a href="http://127.0.0.1:1025" rel="noopener noreferrer"&gt;http://127.0.0.1:1025&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F07sgq9mk94b1i07c1r0w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F07sgq9mk94b1i07c1r0w.png" alt="Zola initial page" width="800" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Browsing Zola themes
&lt;/h4&gt;

&lt;p&gt;You may visit the &lt;a href="https://www.getzola.org/themes/" rel="noopener noreferrer"&gt;Zola Themes page&lt;/a&gt; to browse and choose a suitable theme for your website. Detailed configuration instructions for each theme can be found on the respective themes page. For this article, we will be using the theme &lt;a href="https://www.getzola.org/themes/boring/" rel="noopener noreferrer"&gt;“Boring”&lt;/a&gt; as an example.&lt;/p&gt;

&lt;h4&gt;
  
  
  Installing theme
&lt;/h4&gt;

&lt;p&gt;To install theme run the following command from your project directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git init
git submodule add https://github.com/ssiyad/boring themes/boring

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Build CSS&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd themes/boring
yarn install --frozen-lockfile
yarn build

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy following theme files to root project directory&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. themes/boring/static/
2. themes/boring/templates/
3. themes/boring/css/
4. themes/boring/content/

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Run site in local
&lt;/h4&gt;

&lt;p&gt;Run following command from root project directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;zola serve

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Netlify deployment
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Move site to Git provider:&lt;/strong&gt; Push your site to any of your preferred Git providers like Github, Gitlab, and Bitbucket.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Netlify Account:&lt;/strong&gt; If you don’t have one already, create a free Netlify account &lt;a href="https://www.netlify.com/" rel="noopener noreferrer"&gt;https://www.netlify.com/&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;New Site:&lt;/strong&gt; Log in to Netlify and click on “New site” to create a new project.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Connect to Git:&lt;/strong&gt; Netlify offers integration with various Git providers like GitHub, GitLab, and Bitbucket. Choose your preferred provider and connect Netlify to your Zola project repository.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Deployment Configuration (Optional):&lt;/strong&gt; While Netlify can automatically detect Zola projects, you can create a netlify.toml file in your project’s root for more control. This file allows you to specify the Zola version and other build configurations &lt;a href="https://www.getzola.org/documentation/deployment/netlify/" rel="noopener noreferrer"&gt;https://www.getzola.org/documentation/deployment/netlify/&lt;/a&gt;. The basic configuration looks like this:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[build]
publish = "public"
command = "zola build"

[build.environment]
ZOLA_VERSION = "your_desired_zola_version" # Optional: Specify Zola version

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Deployment:&lt;/strong&gt; Once the connection with your Git repository is established, Netlify will monitor your project for changes. Any push to your main branch (usually named “main” or “master”) will trigger Netlify to rebuild your site using the zola build command and deploy the generated content in the public directory.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Custom domain:&lt;/strong&gt; Go to domain managenent section for your site on Netlify to setup your custom domain.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Previewing and Going Live
&lt;/h2&gt;

&lt;p&gt;Netlify provides a preview URL for your site during development. This lets you see how changes look before they go live. Once you’re happy with your deployment, Netlify offers a simple toggle to publish your site to a custom domain name or a free Netlify subdomain.&lt;/p&gt;

&lt;p&gt;With these steps, your Zola site should be up and running on Netlify! Netlify offers additional features like environment variables, build plugins, and custom headers, allowing you to further customize your deployment process. Refer to the official Netlify documentation for a deeper dive into these functionalities &lt;a href="https://docs.netlify.com/site-deploys/create-deploys/" rel="noopener noreferrer"&gt;https://docs.netlify.com/site-deploys/create-deploys/&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>zola</category>
      <category>netlify</category>
      <category>blog</category>
    </item>
  </channel>
</rss>
