Changeset 6 in code for trunk/main.go


Ignore:
Timestamp:
Dec 14, 2022, 1:13:52 AM (2 years ago)
Author:
koizumi.aoi
Message:

Bugfix release: encode spaced words

Signed-off-by: Aoi K <koizumi.aoi@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/main.go

    r5 r6  
    1 // $KyokoNet: stcli-go,v 1.1 2022/12/13 10:07:00 akoizumi Exp
     1// $KyokoNet: stcli-go,v 1.2 2022/12/13 22:13:00 akoizumi Exp
    22// Command line client for SimplyTranslate, a privacy friendly frontend to Google Translate
    33package main
     
    1010        "log"
    1111        "net/http"
     12        "net/url"
    1213        "os"
    1314)
     
    4142        var translate Translate
    4243        // Build the full URL to query
    43         var queryURL = instance + "?engine=" + engine + "&from=" + from + "&to=" + to + "&text=" + input
     44        var encinput = url.PathEscape(input)
     45        var queryURL = instance + "?engine=" + engine + "&from=" + from + "&to=" + to + "&text=" + encinput
    4446        // Begin the request and process the response
    4547        req, err := http.Get(queryURL)
Note: See TracChangeset for help on using the changeset viewer.