Encoding of the string for HTTP Post

Hello

I work with HTTP get and post at the moment, I have a server with a REST of apache based interface. Obtaining and displaying the data are no problem for 'normal' strings and characters, but I can't send characters like German "Umlaut" (Ä Ü Ö) or Japanese or Chinese characters. Coding for the Socket connection is UTF-8 and the command POST also contains a line of Content Type with character set UTF-8. The server expects UTF - 8, so I need my data in this encoding.

When I send strings of InDesign now, I always get an error 'Bad Request' from my server. Looks like that the strings in ESTK is not UTF-8 - How can I create UTF-8 strings? I can't find methods of encoding conversion...

Thank you

Klaus

OK, it took a while to find that - maybe someone else has the same problem and it is looking for a solution, I'll try to explain:

I downloaded the source files for tomcat to know how tomcat with my data. I debugged deep into the code until I reached the CotoyeInputStream - here the reading of data from InDesign. And although I understood that the stream is read in the form of bytes and characters are counted. The Umlaute and other special characters are encoded as two bytes, but they are counted as a single character. For every Umlaut transferred the number of bytes is 1 higher than the number of characters.

And at a time the flow is cut to the number of characters.

So these are 13 bytes and 12 characters:

{'name': 'u'}

The byte stream is cut to 12 - last byte is lost and it will happen in my application server:

{'name': 'u'}

Support of closing is absent and that throws the Exception.

My simple solution/solution: I'm adding several spaces. Tomcat is always cut the last characters, but now there are only spaces to be cut. And with spaces, it worked...

Tags: InDesign

Similar Questions

  • How to manually change the ports for HTTP on the server vCenter Server

    Hello Experts,

    We have Windows Server 2008 SP2 machine where we v5.1 installed with other SSO components, inventory services, vCenter Server and Update Manager.

    So we went from SSO, the inventory services and vCenter Server fine however, vCenter Server has stopped working. While we were to modernize SSO, the service could not start after the upgrade and the recd suite error "Service VMware KDC service could start.". So, we found the article on the VMware site that said port 88 to cause the problem. To find out more by using the netstat command, we found vpxd.exe used port 88. That is why, we stopped this service and proceeded to the upgrade of the SSO. The upgrade is complete following the inventory service and vCenter Server. While we were upgrading vCenter Server, we found that port 88 was used for HTTP communication.

    So we wasted on the use of the port. The upgrade has been completed successfully, however, we can not connect to vCenter server using vSphere Client version 5.1 or 5.5. We even tried to start the VMware VirtualCenter server using the services.msc console and it failed.

    So we assume the port changes happened during upgrade of the SSO meets the HTTP port by vCenter server usage. We need help on how to manually change the ports for HTTP on the vCenter server.

    Suggestions forward. This problem is with the production servers.

    Thank you

    Karan

    This has been resolved... port has been changed manually and works very well.

  • QT_TR_NOOP() macro does not mark the string for the extraction of the .ts file

    Hello

    Because I want to put all the translatable texts in one place, I defined a separate category for that. The .h file similar to below:

    #ifndef TEXTCONSTANTS_H_
    #define TEXTCONSTANTS_H_
    
    #include "qobject.h"
    
    class TextConstants : public QObject {
        Q_OBJECT
    
    public:
        static const char *SWITCH_APP;
    };
    
    #endif /* TEXTCONSTANTS_H_ */
    

    And the .cpp file similar to below:

    #include "TextConstants.h"
    
    const char *TextConstants::SWITCH_APP = QT_TR_NOOP("Switch App");
    

    Note that in the file above, I use QT_TR_NOOP() macro to mark the string given for extraction of the .ts file. This is mentioned in the documentation at https://developer.blackberry.com/native/documentation/cascades/device_platform/internationalization/....

    I then called tr (TextConstants:WITCH_APP) in a different subclass of QObject. The problem is that the text "App switch" is not extracted from the .ts file, why? If I call tr() and skip the text "App Switch" like tr ("Switch App"), this text is extracted from the .ts file. Am I missing a few things to make it work? Thank you.

    PS. I use® for QNX Momentics® IDE for BlackBerry® 10 native SDK, Version: 10.1.0, Build id: v201303191709

    Hello.

    I think you have misunderstood my suggestion.  I was only suggesting that you call the function tr() in your statement of constant ithat you posted nstead of QT_TR_NOOP(), not in other parts of your code, to see if the compiler accepts it and the chain gets extracted correctly.

    If this does not work, I'll try to track down the code of the work for the purposes of comparison.

    Sorry if I wasn't clear before.

  • Set the string for LabView dll parameter

    Hello

    I created a simple vi LV 2010 (departure vi), which reads the identification of an oscilloscope. Then I take this vi and incorporate it into a dll of LabView. I have test the dll calling LabView (RunFrom dll). Basically, it seems to work, but len and ReadBuffer back empty. It must be in the way I'm configuration configuring the setting for Readbuffer (settings) in the configuration of the dll. I tried several different configurations, but nothing seems to work. Any help is appreciated!

    What is the parameter len?  Normally, you should only set the length of the string, but it seems that you did not do this.  Also, you're passing len by value, and not by reference, so the function is expecting her to be a starter and you will never get return a different value to any value that you provide.

    Do not use a local variable of the ReadBuffer for entry "readbuffer".  You must pass a string initialized long enough to contain the expected quantity of data.  The best way to proceed is to use the array to initialize to create a table of U8, then use the array of bytes to a string.  Set the parameter 'minimum size' to 'len' then run through the length of the string initialized (this is not mandatory but is recommended).  If you need the length obtained output, add another indicator and another parameter to this value.  There might be a way to do it with one by len parameter passing by reference, you need to experiment (it is certainly feasible in C but I don't know if allows him to LabVIEW).

  • probably caused by the settings of the firewall on your computer. Check the settings for HTTP port (80), HTTPS port (443) and FTP.

    Change the title: internet connection.

    Unable to connect to the internet, suddenly, message that I can't connect to the internet using HTTP<>< or="" ftp.="" thios="" is="" probably="" caused="" by="" firewall="" settings="" on="" your="" computer.="" check="" settings="" for="" http="" port(80),="" https="" port(443)="" and="" ftp.="" funny="" i="" was="" just="" on="" the="" net="" not="" more="" than="" 10="" minutes="" prior="" to="" this.="" checked="" all="" conections-="" good.="" what's="" my="" next="">

    Try a system restore to a Date before the problem began:

    Restore point:

    http://www.howtogeek.com/HOWTO/Windows-Vista/using-Windows-Vista-system-restore/

    Do Safe Mode system restore, if it is impossible to do in Normal Mode.

    Try typing F8 at startup and in the list of Boot selections, select Mode safe using ARROW top to go there > and then press ENTER.

    Try a restore of the system once, to choose a Restore Point prior to your problem...

    Click Start > programs > Accessories > system tools > system restore > choose another time > next > etc.

    http://www.windowsvistauserguide.com/system_restore.htm

    Read the above for a very good graph shows how backward more than 5 days in the System Restore Points by checking the correct box.

    See you soon.

    Mick Murphy - Microsoft partner

  • What is the recommended method to shorten the strings for a given width

    I know how to detect the width required for a string using the font and size.

    I also know that the available width for the string

    If I detect that the width of the string is > available width what is better (or recommended) allows to shorten the chain?

    ex: 'It is my example text' is too long

    and 'it's maybe my examp... "fits exactly to the width that can be drawn from graphics

    is there an API for this, or should I reduce the length and try until his short enough?

    THX 4 info

    There is an API for just that - no need to mess with shortening of the chain yourself to all:

    Graphics.drawText(text, x, y, DrawStyle.ELLIPSIS, availableWidth)
    
  • How can I change the ID for my poster?

    Hello everyone. I'm changing the ID on my poster to determine who is my 'PC' view and that is my 'second' screen. My current setup is an Acer H243H monitor and a LG TV. The monitor is connected via DVI and the TV is connected via HDMI. The screens are connected to a NVIDIA GTX 660.

    Currently, even if I have my monitor set as my main/main screen, it appears as ID #2 in the Control Panel, and when I press the Windows and P key, it's my second 'screen '. If I press the Windows and P and choose 'PC screen' only it displays only for me TV. It is the exact opposite of what I want. I want that my monitor to set as the ID #1 so that it can be defined as "the screen of my PC. Does anyone know how to do this?
    Before someone asks, my drivers are all up to this date, I tried to change which monitor is my main screen, etc. It did make a difference.

    Hi Logan,.

    Windows will assign as reports of material, this is normal. However as a work all about you, try this step. Check if it helps.

    a. right click on the desktop to open the Screen Resolution window.

    b. change the appearance of your display click and drag one of the monitors on its correct location to another.

    c. now check to see if it helps.

    Hope this information helps. Answer the post with an up-to-date issue report to help you further.

  • I can't connect to xbox live on windows8 and updates until get game and then nada nothing. I know it's not my connection because I use the connection for this post (I'm in oz)

    I tried like 10 times to get the collection of solitaire to update, I tried to upgrade the application games and nothing works. I checked my firewall settings still nothing.

    I can't connect to xbox live via the above. I know that's not me, i'm at my wits end

    Help!

    Hi André,.

    This seems to be a problem with your Xbox Live account. So, I suggest you to post this query on the Xbox Live Forums since this link:

    http://www.Xbox.com/en-us/forums

    Hope this information helps you.

  • Wildcard characters in the string for NthWord

    I have a script that looks through the pages to see if the 70th word on each page is equal to a code number.

    This number is unique for each instance: for example 1090089, 10704591 but always will start with number one.

    I am not coming with an expression javascript for a wild-card search call, the rest of the script is allowed.

    Can someone please offer assistance with the Joker of the script search component works correctly?

    var this.numPages = NUMPAGES;

    for (var k = 0; k < numpages; k ++)
    {
    {
    numWords var = this.getPageNumWords (k);
    for (var i = 0; i < numWords; i ++)
    {
    var ckWord = this.getPageNthWord (k, i, true);

    var q = this.getPageNthWordQuads (k, i);
    Convert quads in the rotation by default user space
    Userspace used by links.
    m = (new Matrix2D).fromRotated(this,0);
    mInv = m.invert)
    r = mInv.transform (q)
    r = r.ToString)
    r = r.split(",");

    If (ckWord == '1' + / d\d\d\d\d\d\ / & & I == 70))
    {
    Console.println ("Code number is" + "Page" + (k + 1));
    }
    }
    }
    }

    It is not clear what restrictions there are on the code you are looking for, but the following will match a string that starts with "1" followed by six digits or more:

    If (ckWord.match(/^1\d{6,}$/) & I == 70) {}

  • How to check the expense for assets posted account

    Dear,

    can someone explain how to verify the account of capital Asset Workbench?

    You can see the expense in financial investigation 11i account, but you can see in R12 to the account of expenses in respect of assignments.

  • HTTP Post documentation does not mention the forums (BUG)

    Documents of the VI of HTTP post (see here) do not mention that there are 2 instances of this VI. It contains only the help on the string instance.

    Right-click on the VI shows that it is a polymorphic VI, with a buffer (string) and the instance of the file (paths).

    Aid for these screws would normally have a ring "Instance" where you could see that there are other forums. (example)

    This absence made me several hours of debugging, because the buffer method stops playback of the chain after finding a NULL byte. (this could be a separate bug).

    In my opinion all polymorphic screws should show their terminal selector.

    Tone

    Your dear,

    I reported the problem of documentation in corrective action request # 244384. I'll have another look in the question on the search for the null byte. Thank you for bringing this place.

    Best regards

  • HTTP POST: Returns a response of login instead of a JSON response page

    Dear all,

    I just glued a snippet of code for HTTP Post where I WRITE a message to multiple parties to the server that will
    Authentication. I expect a response the following JSON. But when I run the present I always LOGIN
    Page in HTML.

    Can someone let me know the problem in the code below...

    Thanks a ton for your help.

    Thank you
    MGR

    / public final class MyScreen extends form {}
    private RichTextField _Output;
    public MyScreen() {}
    Set the displayed title of the screen
    setTitle ("MyTitle");

    _Output = new RichTextField();
    Add (_output);
    addMenuItem (_GetDataAction);
    }
    protected _GetDataAction MenuItem = new MenuItem ("GetData", 100000, 10) {}
    public void run() {}
    String URL = "";
    ServiceRequestThread svc = new ServiceRequestThread (URL,
    (MyScreen) UiApplication.getUiApplication)
    (. getActiveScreen());
    SVC. Start();
    }
    };
    {} public void updateDestination (final String text)
    UiApplication.getUiApplication () .invokeLater (new Runnable() {}
    public void run() {}
    _Output.SetText (Text);
    }
    });
    }

    }
    class ServiceRequestThread extends Thread {}

    protected String _URL;
    protected MyScreen _Dest = null;
    protected URLEncodedPostData _PostData = null;
    StringBuffer writer = new StringBuffer();

    {} public void setPOSTData (URLEncodedPostData data)
    _PostData = data;
    }

    public ServiceRequestThread (String URL, display MyScreen) {}
    Super();
    Dest = screen;
    _URL = URL;
    }

    public void run() {}
      
    Try
    {
    String limit = "SATBA";
    String twoHyphens = "-";
    "{String data1 = '{\"IMPORTING\': {\"IN_COUNTRY_CODE\":\"US\'}} ';
    String CRLF = "\r\n";
    Byte [] encrypted = Base64OutputStream.encode ("Userassword".getBytes (), 0, "userassword".length (), false, false);
           
    "Preparing the post data.
         
    Writer.Append ("-" + boundary) .append (CRLF);
    Writer.Append ("Content-Disposition: form-data;") Name = ()-"param\" ")." Append
    CRLF);
    Writer.Append ("Content-Type: text/json;") charset ="+" UTF - 8 ") .append (CRLF);
    Writer.Append ("Content-Transfer-Encoding: 8 bit") .append (CRLF);
    Writer.Append ("request - ID:Abcd123456"). Append (CRLF);
    Writer.Append("request-type:rfc_json"). Append (CRLF);
    Writer.Append ("Function:00163E0136C01EE0AE8B059433A71727")
    . Append (CRLF);
    Writer.Append (CRLF);
    Writer.Append (data1). Append (CRLF);
    Writer.Append("--" + Boundary + "--"). Append (CRLF);
    String string = new String (writer);
                           
    HttpConnection conn1 = (HttpConnection) Connector.open (_URL, Connector.READ_WRITE);
    conn1.setRequestMethod (HttpConnection.post);
    conn1.setRequestProperty ("authorization", "Basic" + new String (encoded));
    conn1.setRequestProperty ("Content-Type", "multipart/mixed; limit =" + limit);
     
    OutputStreamWriter osw is new OutputStreamWriter (conn1.openOutputStream (), 'UTF-8');.
    OSW. Write (String);
    OSW. Flush();
    OSW. Close();
       
    int responseCode = conn1.getResponseCode ();
    If (responseCode == HttpConnection.HTTP_OK) {}
    Given InputStream = conn1.openInputStream ();
    Gross StringBuffer = new StringBuffer();
    Byte [] buf = new byte [4096];
    not read int = data.read (buf);
    While (not read > 0) {}
    RAW. Append (new String (buf, 0, read));
    not read = data.read (buf);
    }
    _Dest.updateDestination (RAW. ToString());
    } else {}
    _Dest.updateDestination ("responseCode ="
    + Integer.toString (responseCode));
    }
    }
    catch (IOException e)
    {
    e.printStackTrace ();
    _Dest.updateDestination("exception:"+e.ToString());)
    }
    }

    }

    Hello

    Thank you very much code was perfectly fine and she is on property rim.public of the file where the

    application.handler.http.AuthenticationSupport has been set to true, and because of this in the fact that he wasn't loggging.

    Now I put it to false, and the correct answer came.

    Thank you very much.

    Best regards

    MGR

  • Problem when using SOAP requests with HTTP POST function

    Hello!

    Using the vi of HTTP POST to send SOAP requests to a device, I encountered a problem.

    Take care of the HTTP header for you HTTP POST vi and defines the type of 'content' as "Content-Type: application/x-www-formulaires-urlencoded. Who is considered to be 'non-soap' requests by some Web servers.

    Standards W3C says in this case, you should be content-type: "application/soap + xml".

    Link to the page to W3C standard: http://www.w3.org/TR/soap12-part0/#L26866

    That is possible to update this feature in a future release so that programmers can choose (or type) the necessary content type?

    Have you tried "Add header" to change?

    http://zone.NI.com/reference/en-XX/help/371361L-01/lvcomm/http_client_addheader/

  • How to increase the timeout for download on GBA?

    Hello

    We try to download a large file (50 to 75 MB) PDF to our Association. But we have always had an HTTP timeout. Send us the request typical HTTP POST to .../Packaging/Package with some parameters.

    I think there should be some options for the packaging.conf file in / etc to increase the time-out period. But unfortunality I wasn't able to find these options in the documentation. Maybe I'm blind too.

    Can you help me please? Is there a list with all the options for packaging.conf, fulfillment.conf and admin.conf? May I can find other interesting options in this list.

    Thank you in advance!

    Kind regards

    Nicolas

    I upload the file via SFTP in a location known and accessible to the service of packaging and if you send the application package using the dataPath option, not the data option.
    This will also help with the use of memory on the server package.

  • Convert resultlist container to a string for report

    Hi all

    Is there a way to convert a resultlist containing a string? I have a ResultList of a separate test that I need to add to the ModifyBatchReportHeader point of the string for my report in ASCII format.

    I tried adding "str (OtherTestResults)", but it adds just periods as if he doesn't know how to access the test data (name test, measure, etc.). Is there a a way to convert it containing a string the TestStand way automagically done at other times?

    Thank you

    Chris

    Hi Chris,

    Unless you said, I did not realize the batch mode.

    For my example, I used the ModifyBatchReportFooter. You can also use the header.

    You just have to play with the HTML tags.

    This example only works with HTML-reports!

    For the generation, it uses the sequence: PutResultsInReport reportgen_html.seq in the template folder - OR

    Hope this helps a little more

    Jürgen

Maybe you are looking for

  • sync iPhone error

    Hi guys I recently updated my IOS to 9.2.1 my phone is synchronized with no problem but now im getting a pop-up window that gives me an error I have tried everything and my computer is allowed now can't sync my music or apps that is really lame, coul

  • I want to format fo my xp system, but I want my data as usual subsistence in the pc. So what to do for the format retain data

    I want to format fo my xp system, but I want my data as usual subsistence in the pc. then I have to format retain data mean my data not format. (do not delete)

  • SDS nVMe on t630

    I own a dell server t630 no pcie hardware flash. How to have two nvme SDS samsung xs1715 that the dell hardware must provide how would these two ssd drives can be used in dell t630? Or material not dell. THX Alex

  • Toshiba laptop crashed two days ago and kept restarting itself

    I have this laptop for 2 years.  toshiba lap top was brand new when I bought it.When my lap top has crashed, I tried to fix it but kept rebooting the computer.  Thought I had to reformatt HDD.  Thought that the Toshiba recovery disks loaded windows. 

  • recovery kit with regard

    Hi I have a question about my laptop recovery. I buy my laptop this year in June thereOS is corrupted then consultant hp me says to buy CDs of restoration that cost me about 5-600 it consist recov CDs and window 8.1 and some other stuff (my question