stlehmann / pyads

Python wrapper for TwinCAT ADS
MIT License
252 stars 93 forks source link

Use cp1252 as default encoding for Strings #301

Open stlehmann opened 2 years ago

stlehmann commented 2 years ago

I've been experimenting now a little bit with the string encoding in Twincat. According to the infosys it's an cp1252 encoding for the normal string. Shouldn't we integrate that one instead of the utf-8? I tried it with the write_by_name function (adsSyncWriteReqEx) and now you can write with ASCII 256 and the plc shows it the right way. Encoding_cp1252

It doesn't solve my problem with the utf-8 encoded Strings but at least you can write and read special characters with the normal strings.

Originally posted by @hkalteBr in https://github.com/stlehmann/pyads/issues/300#issuecomment-999379365