hope PB-chm:when Character>127 To "&#"+Str(Character)+";"

Found an issue in the documentation ? Please report it here !

Moderator: Documentation Editors

User avatar
gurj
Enthusiast
Enthusiast
Posts: 693
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

hope PB-chm:when Character>127 To "&#"+Str(Character)+";"

Post by gurj »

When the PBCHM is opened on Chinese X86WIN7, there will be garbled if the character value is> 127. If it is changed to the real character set, it will be correct and general. Below is my processing code:
first,chm to html to director:chm-html\

Code: Select all

Global n,m
Procedure ListFiles(directory.s,directoryid)
 If ExamineDirectory(directoryid,directory,"*.*")
  While NextDirectoryEntry(directoryid)
   file.s=DirectoryEntryName(directoryid)
   Select DirectoryEntryType(directoryid)
    Case #PB_DirectoryEntry_File
     this_extension.s=LCase(GetExtensionPart(file))
     If this_extension="html" Or this_extension="htm":file=directory+file:fz1=FileSize(file)
      If OpenFile(0,file,#PB_Ascii):r=1:ss.s="":While Eof(0) = 0
       v.a=ReadAsciiCharacter(0)
        If v>127:If r=1:r=2:m+1:Debug file:EndIf:n+1;''=127
         ss.s+"&#"+Str(v)+";":Else:ss.s+Chr(v):EndIf
        Wend:CloseFile(0):If r=2:CreateFile(0,file,#PB_Ascii):WriteString(0,ss):CloseFile(0):EndIf
    EndIf:EndIf
    Case #PB_DirectoryEntry_Directory
     If file<>"." And file<>"..":ListFiles(directory+file+"\",directoryid+1):EndIf
 EndSelect:Wend:EndIf
EndProcedure
dt=Date()
;TODO
directory.s="chm-html\"
temp.s=Right(directory,1)
If temp<>"\" And temp<>"/";/,\,/\,\/�ǵȼ۵�
directory+"\":EndIf
Debug "bug files:"
ListFiles(directory,0); the last parameter should be zero
Debug "bug files,Count="+Str(m)+"; bug,Count="+Str(n)
Debug "time use,minute:"+Str((Date()-dt)/60)
my pb for chinese:
http://ataorj.ys168.com
User avatar
NicTheQuick
Addict
Addict
Posts: 1510
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: hope PB-chm:when Character>127 To "&#"+Str(Character)+";"

Post by NicTheQuick »

This is also related to this topic of mine: https://www.purebasic.fr/english/viewto ... 64#p636164
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
User avatar
gurj
Enthusiast
Enthusiast
Posts: 693
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

Re: hope PB-chm:when Character>127 To "&#"+Str(Character)+";"

Post by gurj »

PB's ASCII listing 256 characters, actually ASCII extension, should be called Eascii.
my pb for chinese:
http://ataorj.ys168.com
User avatar
gurj
Enthusiast
Enthusiast
Posts: 693
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

Re: hope PB-chm:when Character>127 To "&#"+Str(Character)+";"

Post by gurj »

topic code,time is 2017,from my old file.
but
The original author of Listfiles () forgets who is. Sorry and thanks!
my pb for chinese:
http://ataorj.ys168.com
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2139
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: hope PB-chm:when Character>127 To "&#"+Str(Character)+";"

Post by Andre »

I think this is related to this one too: viewtopic.php?t=85124
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
gurj
Enthusiast
Enthusiast
Posts: 693
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

Re: hope PB-chm:when Character>127 To "&#"+Str(Character)+";"

Post by gurj »

remarks:
purebasic.chm,*.html use ansi[1250] to open is ok,but chr.html and asc.html use utf8 is ok.
========other:
in string/chr.html:
Chr(8364)=€=&#128;
Chr($BC)=1/4=&#188;
Chr(8364)=1/2=&#189;

in string/asc.html,i changed $2630 to $2640:
Chr($2640)=;cannot use &#*;
Chr($25BC)=;cannot use &#*;
my pb for chinese:
http://ataorj.ys168.com
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2139
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: hope PB-chm:when Character>127 To "&#"+Str(Character)+";"

Post by Andre »

Should be fixed with PB6.21 final, for which Fred changed all doc files to UTF8 and used a new DocMaker version for creating the 'PureBasic.chm' help file?
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
Post Reply