Share this page

# web_sjis_to_euc_param

Miscellaneous Functions

Converts an SJIS string to EUC and assigns it to a parameter.

    int web_sjis_to_euc_param( LPCSTR param_name, LPCSTR param_value_in_SJIS );

Argument | Description
--- | ---
object | An expression evaluating to an object of type WebApi. Usually web for Java. See also Function and Constant Prefixes.
param_name | The name of the parameter. No spaces are allowed.
param_value_in_SJIS | A null-terminated string in SJIS to be converted to EUC and assigned to the parameter.

## Return Values

This function returns LR_PASS (0) on success, and LR_FAIL (1) on failure.

## Parameterization

The following argument(s) can be parameterized using standard parameterization: param_name and param_value_in_SJIS

## General Information

The web_sjis_to_euc_param function converts a null-terminated string encoded in SJIS to a string encoded in EUC, and assigns it to a parameter. You can use the lr_eval_string function to determine the value of the parameter.

During recording, VuGen converts an EUC string sent by the server to SJIS and sends it to an Action function. The web_sjis_to_euc_param function is added before the Action function, and its parameter is inserted into the Action function. During replay, VuGen uses the web_sjis_to_euc_param function to convert the string back to EUC and store it in a parameter. The parameter is then used for subsequent Action functions.

This function only applies to the Japanese Edition. It is supported for all web scripts.

## Examples

### Example 1

In the following example, a user submits a request to find an employee by the name of "John Green" who is "35" years old. The strings "John Green" and "35" are first converted from EUC to SJIS.

Copy code

    web_sjis_to_euc_param("Name", "John Green")
    web_sjis_to_euc_param("Age", "35");
    web_submit_form("search.exe",
         ITEMDATA,
         "name=employees.NAME", "Value={Name}", ENDITEM,
         "name=employees.AGE", "Value={Age}", ENDITEM,
          LAST );

### Example 2

In the following example, the message, "Customer name is: Peter Brown", is converted from SJIS to EUC and sent out.

Copy code

    lr_save_string("Peter Brown", "SubParam");
    web_sjis_to_euc_param("Param_main", "Customer name is:
        {SubParam}");
    lr_output_message("%s", lr_eval_string("{Param_main}"));

### Example 3

Manual conversion of an SJIS string to EUC

A browser converts an EUC–encoded web page into SJIS encoding before displaying it. However, when you view the source of the web page, the text strings are still in EUC. If you want to search for a string in the source view, which is SJIS–encoded in the browser view, you must first convert the string back to EUC.

In the following example, the web_sjis_to_euc_param function converts the SJIS–encoded string, "search for this string" to EUC and searches for it in the EUC–encoded text.

Copy code

    web_sjis_to_euc_param("Param_Text", "search for this string");
    web_find("Text check", "What={Param_Text}", LAST );.

### Example 4

Correlation with right and left boundaries

In the following example, the web_sjis_to_euc_param function defines left and right boundaries, and converts them from SJIS to EUC to retrieve a string between the boundaries. This string is the session ID of a URL. The string is then sent to the Controller.

Copy code

    web_sjis_to_euc_param("Param_LB", "My Left Boundary in SJIS");
    web_sjis_to_euc_param("Param_RB", "My Right Boundary in SJIS");
    web_reg_save_param("ParamMain", "LB={Param_LB}", "RB={Param_RB}",
        LAST );
    web_url("yahoo", "URL=http://www.yahoo.co.jp/SessionID={ParamMain}",
       LAST );
    lr_output_message("%s", lr_eval_string("{ParamMain}"));

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: