# How to convert String to Shift.Jis or Other data type to shift.jis

**URL:** <https://forum.inductiveautomation.com/t/how-to-convert-string-to-shift-jis-or-other-data-type-to-shift-jis/67533>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [December 13, 2022, 2:33am UTC](https://forum.inductiveautomation.com/t/how-to-convert-string-to-shift-jis-or-other-data-type-to-shift-jis/67533 "2022-12-13T02:33:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alagumani\_Kaliyaperu](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@Alagumani\_Kaliyaperu](https://forum.inductiveautomation.com/u/Alagumani_Kaliyaperu)\
**Post date:** [December 13, 2022, 2:34am UTC](https://forum.inductiveautomation.com/t/how-to-convert-string-to-shift-jis-or-other-data-type-to-shift-jis/67533/1 "2022-12-13T02:34:00Z")

</div>

Hi All  
I want to Convert string data type to Shift.jis data type to send the some value to Keyence PLC. I am using Kepware as a third party party communication software between Ignition and Keyence PLC.  
Kindly give your suggestion.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [December 13, 2022, 4:57pm UTC](https://forum.inductiveautomation.com/t/how-to-convert-string-to-shift-jis-or-other-data-type-to-shift-jis/67533/2 "2022-12-13T16:57:54Z")

</div>

Possibly something like this:

```python
from java.lang import String

test = u"ö test string"
javaString = String(test)

#print javaString.getBytes("UTF-8")
print javaString.getBytes("Shift-JIS")

```

---

<div class="post-metadata">

**Author:** ![Alagumani\_Kaliyaperu](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@Alagumani\_Kaliyaperu](https://forum.inductiveautomation.com/u/Alagumani_Kaliyaperu)\
**Post date:** [December 14, 2022, 1:48am UTC](https://forum.inductiveautomation.com/t/how-to-convert-string-to-shift-jis-or-other-data-type-to-shift-jis/67533/3 "2022-12-14T01:48:47Z")

</div>

Thanks for your reply actually I want to write some value from Ignition to Keyence PLC.  
My Ignition Data type is String and Keyence PLC data type is "shift.Jis".

I am looking for some code that should Convert the data type and write the value to PLC address.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [December 14, 2022, 2:12am UTC](https://forum.inductiveautomation.com/t/how-to-convert-string-to-shift-jis-or-other-data-type-to-shift-jis/67533/4 "2022-12-14T02:12:14Z")

</div>

You said Kepware is acting as the OPC server - what is the datatype of the Kepware tag you're using?

---

<div class="post-metadata">

**Author:** ![Alagumani\_Kaliyaperu](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@Alagumani\_Kaliyaperu](https://forum.inductiveautomation.com/u/Alagumani_Kaliyaperu)\
**Post date:** [December 15, 2022, 9:10am UTC](https://forum.inductiveautomation.com/t/how-to-convert-string-to-shift-jis-or-other-data-type-to-shift-jis/67533/5 "2022-12-15T09:10:30Z")

</div>

Hi All  
Sorry I wrongly understood the existing communication concept. we are replacing existing Keyence HMI with Ignition. Actually in Keyence PLC the data type is String and in Keyence HMI it is Shift.jis.  
we faced some communication issues when communicate through the KEPware.  
Now we are directly communicating Keyence PLC directly using Keyence Build-in OPC UA.  
Now it's working fine. But I am not sure not sure why the KEPware not accepting the string datatype for particular address.  
I will attach the screen shots of KEPware error message.

Thanks for your support.

 ![MicrosoftTeams-image (11)](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/d/edb209740650dcae2646005fd2a1e7ca2b119887.png)  
 ![MicrosoftTeams-image (10)](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/5/75e03ab1af5b88b1ca124a7bb9dde47f16c224da.png)
