Author Topic: import strings with complex characters  (Read 792 times)

0 Members and 1 Guest are viewing this topic.

monliv

  • Newbie
  • *
  • Posts: 30
    • View Profile
import strings with complex characters
« on: May 23, 2023, 05:19:18 PM »
I'm importing a .txt file via the lineread command '<name>Ören, Aras</name>'

when importing, the string "Ören Aras" debug looks like this {\-61, \-106, ren Aras\0, \0, \0, \0,}

unfortunately in planetdance it is displayed as 'Ören Aras'

do you have a solution to the problem? Thanks
 :'(
« Last Edit: May 23, 2023, 05:23:16 PM by monliv »

Jean

  • Administrator
  • Hero Member
  • *****
  • Posts: 1086
    • View Profile
Re: import strings with complex characters
« Reply #1 on: May 23, 2023, 05:36:51 PM »
Hi Livio,
Convert your .txt file to Asci Encoding with notepad++ or such, and try again.
Greetings from Groningen Netherlands <º)))><¸.·´¯`·.¸><(((º>

monliv

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: import strings with complex characters
« Reply #2 on: May 23, 2023, 07:55:55 PM »
already done. The text always comes out the same.
For me the problem is how it decomposes the string
inserting the special characters or the escape sequence
which is not translated correctly.

From planet dance I made some tests with special characters in the name:
if I export from PD the string name 'Ören Aras' to Txt I get 'Ören Aras'
if I import from txt                           'Ören Aras' I get 'Ören Aras' in PD
the curious thing is that if I export from PD 'Ören Aras' I get 'Ören Aras' ?!?
« Last Edit: May 23, 2023, 07:58:27 PM by monliv »

Jean

  • Administrator
  • Hero Member
  • *****
  • Posts: 1086
    • View Profile
Re: import strings with complex characters
« Reply #3 on: May 23, 2023, 08:11:23 PM »
I tried the example you've shown me, it displays ok.
Code: [Select]
window(0, 0);
char b[999];
lineread("d:\in\a.txt", b);
putstring(9,9,b);
run;

But the txt file must be ansi encoded.

Quote
From planet dance I made some tests with special characters in the name:
if I export from PD the string name 'Ören Aras' to Txt I get 'Ören Aras'
if I import from txt                           'Ören Aras' I get 'Ören Aras' in PD
the curious thing is that if I export from PD 'Ören Aras' I get 'Ören Aras' ?!?

Maybe it's something the forum does but to me these all look the same.
Greetings from Groningen Netherlands <º)))><¸.·´¯`·.¸><(((º>

monliv

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: import strings with complex characters
« Reply #4 on: May 24, 2023, 04:47:20 PM »
Thanks for the suggestion, Jean, with Ansi I solved