Jump to content

Special characters, how I hate you


Seminko
 Share

Recommended Posts

Hey fellas,

I have a bunch of words full of special characters like: künstler, アーティスト, 아티스트, художник, ศิลปิน, 畫家 and many many more.

I have those along with other text in an array. For the text to correctly display in the array I used BinaryToString("text", 4) and it works PERFECTLY.

However, when I do FileWrite("file.ini", array[1]), it skips the special chars replacing them with ' ? '.

I tried using FileOpen, which doesn't help a bit. Also tried FileOpen with mode 128 or 256 but with those modes, nothing is written to the file AT ALL.

Any ideas?

Thx

Link to comment
Share on other sites

Are you trying to read the file with IniRead, seeing as it's an ini file?

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

  • Developers

Works fine for me when simply doing:

FileWrite("file.ini", "アーティスト, 아티스트, художник, ศิลปิน, 畫家 ")

then opening file.ini with SciTE.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

2 minutes ago, Jos said:

Works fine for me when simply doing:

FileWrite("file.ini", "アーティスト, 아티스트, художник, ศิลปิน, 畫家 ")

then opening file.ini with SciTE.

Jos

This is what I see when I open the INI: ?—????, ????, ????????, ??????, ?? 

Link to comment
Share on other sites

  • Developers

How do you open the file?  and if with SciTE: what are the file encoding settings when doing File/Encoding?

Jos 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

You're not answering my question .... :)

What editor are you opening the "file.ini" in when you double click it?

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

Ok, lets take this from the start:

  1. copy the line I posted in a new script that has the correct encoding, save and run it.
  2. check the created file.ini.
  3. if still wrong then zip the 2 files and PM the zip file to me.

ps: which Scite version are you using? 

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

You shouldn't need to create the file with anything other than IniWrite or IniWriteSection. There's no reason to use FileWrite first.

If you want your INI file to be unicode compatible look here for how to do it.

 

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...