News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

UTF8 disk I/O library ....

Started by CommonTater, March 10, 2013, 02:13:26 AM

Previous topic - Next topic

CommonTater

DELETED .... because some things just aren't worth the trouble.

Moderator ... please delete this entire thread. 

jj2007

Interesting. Can you give an example how to use it in assembler, similar to this one which reads a Unicode text file into a string array and displays it in the console? Testfile attached.

include \masm32\MasmBasic\MasmBasic.inc        ; download
        Init
        Recall "Wide.txt", L$()
        For_ ebx=0 To eax-1
                wPrint wRec$(L$(ebx)), wCrLf$
        Next

        Inkey
        Exit
end start

Output:
Введите текст  здесь
Нажмите на эту кнопку
Добро пожаловать
أدخل النص هنا
دفع هذا الزر
مرحبا بكم
在這裡輸入文字
按一下這個按鈕
歡迎

CommonTater

Quote from: jj2007 on March 10, 2013, 02:41:27 AM
Interesting. Can you give an example how to use it in assembler

1) No I can't ... and I don't even pretend that I can. 
Unlike you, on Pelles Forums,  I don't climb into areas where I have little or no experience and pretend to know more than the experienced programmers do. Just because you code in ASM does not mean you're smart.

2) Do you even know what UTF8 is? 
Seriously do you understand it's importance in communications and text file storage?  UTF8 is a 32 bit, variable length text format that behaves like ANSI text on most languages and uses the most compact version (usually 2 bytes) only for non-English characters. It can uniquely encode millions of characters, even morse code. Using it in preference to wide strings can cut communication time (almost) in half and reduce disk storage by similar amounts.

3) I posted it here, in a C language sub-forum, because one of the moderators asked me to.

So, no, I'm not going to play your infantile "Wigger Waggling" games.

jj2007

Quote from: CommonTater on March 10, 2013, 03:00:16 AM
2) Do you even know what UTF8 is?

No, Tater, I have no idea what UTF8 is. My code is based on black magic.

Seriously: Why do most of your posts inevitably end in insulting others? I asked a simple question, assuming you were able to give an example, and assuming that you were aware this is an assembler forum. I would even accept a C example, but your library doesn't contain any test case...

Vortex

Hi Jochen,

QuoteI would even accept a C example, but your library doesn't contain any test case...

Did you download and open the attachment? There is already an example in the zip file. You can check the test folder.

CommonTater is a very good and experienced coder. He is not aiming to insult people. Take it easy Jochen.

Attached is a Poasm example using the UTF8 library.

jj2007

Quote from: Vortex on March 10, 2013, 04:33:42 AM
Did you download and open the attachment?
Yes, I had downloaded and opened the attachment. I haven't seen any asm file in there, and the C files lack documentation. Overall it's not impressive.

QuoteCommonTater ... is not aiming to insult people.

Tater started insulting others (Farabi, me, qWord, ...) as soon as he had joined the forum, see this thread. We have generally a good atmosphere here, we can discuss politics without insulting each other, we tease each other but never using words like "idiot", "stupidity", "jackoffs" and "bullshit attitudes"; we even tolerate a certain level of arrogance provided the poster otherwise contributes constructive advice and code. Tater is just bloat and insult - even in his "own" forum he got kicked out, and not by me.

Vortex

Hi Jochen,

QuoteI would even accept a C example,

QuoteI haven't seen any asm file in there.

There is a C example in the test folder. The utf8io.h file provides explanation and it's easy to understand.

CommonTater is also a member of Pelles C forum. Why would he need to attack people as soon as he joined the forum?

jj2007

Quote from: Vortex on March 10, 2013, 05:32:33 AMWhy would he need to attack people as soon as he joined the forum?

Good question, Erol.

Vortex

Hi Jochen,

Everything will be fine. No any problem. We are like a family here. The motto of FIDE -  Fédération internationale des échecs or World Chess Federation can be applied to our forum :

QuoteGens una sumus - We are one people.

CommonTater

Quote from: jj2007 on March 10, 2013, 03:34:50 AM
Quote from: CommonTater on March 10, 2013, 03:00:16 AM
2) Do you even know what UTF8 is?

No, Tater, I have no idea what UTF8 is. My code is based on black magic.

Seriously: Why do most of your posts inevitably end in insulting others?

Because you just beg for it.

Quote
I asked a simple question, assuming you were able to give an example, and assuming that you were aware this is an assembler forum. I would even accept a C example, but your library doesn't contain any test case...

Ok, now I know you didn't even bother to look in the zip file... Not only are there a 32 bit and 64 bit test programs included with it... I gave you the source code for both!

Now kindly be a useful idiot and Smeg off!

CommonTater

Quote from: Vortex on March 10, 2013, 05:32:33 AM
QuoteI would even accept a C example,
QuoteI haven't seen any asm file in there.
There is a C example in the test folder. The utf8io.h file provides explanation and it's easy to understand.

Hi Vortex ... is it not obvious he never even bothered to look?

Quote
CommonTater is also a member of Pelles C forum. Why would he need to attack people as soon as he joined the forum?

Since 2004 ....

CommonTater

Quote from: jj2007 on March 10, 2013, 05:18:48 AM
Tater started insulting others (Farabi, me, qWord, ...) as soon as he had joined the forum, see this thread.

Get your facts straight.  I came here --by invitation-- to give you guys access to some software I was working on (Easy Build)... about 3 months into sharing that freely without question on the forums I ran into a software situation where I felt a) a little out of my depth and b) probably should be written in ASM for optimal performance. 

I asked very nicely if anyone was up to a challenge and would consider writing this code for me... Share and share alike... So, what did I get back?  Some guy goes "I can do that" only to admit 3 posts later that he'd lied; someone else tells me they'll do it for a fee; lots of people refer me elsewhere.... Not one offer to help out...

And there I am staring at my screen in utter disbelief...
This is NOT how this is supposed to work... and I said so.

Were the situation reversed I would have offered to help someone sharing with me,  free of charge. 

Now I've got you on my case in two forums....
And exactly what do you think you're trying to accomplish?
(Other than making a complete ass of yourself, that is)

FWIW ... I finally did get the needed DShow object... it came in around 1350bytes and works a treat. 

jj2007

Quote from: CommonTater on March 10, 2013, 06:39:35 AMSome guy goes "I can do that" only to admit 3 posts later that he'd lied

"Some guy" was our young friend Farabi, and nobody else here would ever call him a liar.

Back to content: I have compiled your test case, no error messages, fine, but when I feed a real UTF-8 file with Russian, Arabic and Chinese characters, I get this on screen:

Reading Utf8.txt
File open...
File content...
↕2548B5 B5:AB  745AL
↔06<8B5 =0 MBC :=>?:C
¶>1@> ?>60;>20BL
#/.D 'DF5 GF'
/A9 G0' 'D21
E1-(' (CE
(↓ß8eçW
         ♂↓♂    §
a╬
(null)
File closed...


Expected outcome is this:
UTF-8 text file created, now reading & printing
Введите текст здесь
Нажмите на эту кнопку
Добро пожаловать
أدخل النص هنا
دفع هذا الزر
مرحبا بكم
在這裡輸入文字
按一下這個按鈕
歡迎


I attach my version (the *.asc source opens best in RichMasm, but WordPad and Ms Word work, too).

Note that I tried it from the commandline, too, using chcp 65001 and Lucida Console. Inside the same console window, my proggie WideReadWrite.exe displays the exotic languages just fine, yours produces garbage. It's a mystery. Could it be the wprintf(L... ?

P.S.: With English UTF-8 text, your library works just fine :t

CommonTater

#13
Quote from: jj2007 on March 10, 2013, 07:17:25 AMNote that I tried it from the commandline, too, using chcp 65001 and Lucida Console. Inside the same console window, my proggie WideReadWrite.exe displays the exotic languages just fine, yours produces garbage. It's a mystery. Could it be the wprintf(L... ?

P.S.: With English UTF-8 text, your library works just fine :t

You feed it a word processor file and then try to claim my library doesn't work when it can't sort out the formatting marks and starts producing errors...




jj2007

Quote from: CommonTater on March 10, 2013, 07:33:44 AM
You feed it a word processor file and then try to claim my library doesn't work when it can't sort out the formatting marks

No, Utf8.txt is a plain UTF-8 text file, of the type you claim to handle with your library. You can open it in Notepad, \Masm32\qeditor.exe, poide.exe, and it will display 9 lines of Russian, Arabic and Chinese text.