Raised This Month: $ Target: $400
 0% 

Trouble with reading first line of a file


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pillowCloud
Member
Join Date: Aug 2015
Location: AlliedModders
Old 08-07-2019 , 02:16   Re: Trouble with reading first line of a file
Reply With Quote #1

Quote:
Originally Posted by edon1337 View Post
That's why you should always show the full code/config.
Quote:
Originally Posted by fysiks View Post
Don't do this:

Code:
replace(text, charsmax(text), "^n", "");
Do this:

Code:
trim(text)
Not sure this is related to your issue but you might also consider attaching the file you're trying to read so that we can look at it in our own editor and even test your code.
Firstable, thank you for trying to help,

I did managed to find the solution, to solve this issue I made 3 changes:
1. I changed the the read text property from "r" to "rt"
2. I removed the quotes from the line that I was read, by remove_all function.
3. MOST IMPORTANT: I created a brand new file encoded with ANSI (the old one was encoded by UTF-8, wich may explain why i wasn't been able to print the first character correctly).

I guess this issue was related to UTF-8 compatibility,
Anyway, thanks again for you all!
pillowCloud is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:22.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode