How to decode HTML-encoded text in MS Access

I have a table field in MS Access 2003 that contains strings encoded in HTML, such as:

Ανταγωνισμός παγκοσμίου επιπέδου στην κατάρτι&#963

How can I decode this into a "normal string" using MS Access?

Thanks in advance.


Here is what I still have. Using the Vb code provided here (BTW I could open this page only from IE7 and not from FF 3.5 or Chrome 2), I wrote the following function

Private Function UnicodeDecode(StringToDecode As String) As String
  Dim TempAns As String
  Dim CurChr As Integer
  CurChr = 1
  Do Until CurChr - 1 = Len(StringToDecode)
    Select Case Mid(StringToDecode, CurChr, 2)
    Case "&#"
      TempAns = TempAns & Chr(Mid(StringToDecode, CurChr + 2, 3))
       CurChr = CurChr + 5
    Case Else
      TempAns = TempAns & Mid(StringToDecode, CurChr, 1)
    End Select
    CurChr = CurChr + 1
  Loop
  UnicodeDecode = TempAns
End Function

Now this works when you specify the decimal value of a character to 255. If I try to execute, for example:

Chr(338)

" ". , MS Access ISOlat1 , . Unicode 913, ISOgrk3.

- , ?

.

+3
5

VB , Access. Access .

+2

msxml6.dll(Microsoft XML v6.0) html- VBA:

Set oDOMDoc = CreateObject("Msxml2.DOMDocument.6.0")
Html = "<Black>"2"
oDOMDoc.LoadXML ("<root>" & Html & "</root>")
HtmlDecode = oDOMDoc.Text
+4

. , 4 (, ) , MS Access. ChrW() Chr().

Public Function UnicodeDecode(StringToDecode As String) As String
  Dim TempAns As String
  Dim CurChr As Integer
  CurChr = 1
  Do Until CurChr - 1 = Len(StringToDecode)
    Select Case Mid(StringToDecode, CurChr, 2)
    Case "&#"
      TempAns = TempAns & ChrW(Mid(StringToDecode, CurChr + 2, 4))
       CurChr = CurChr + 6
    Case Else
      TempAns = TempAns & Mid(StringToDecode, CurChr, 1)
    End Select
    CurChr = CurChr + 1
  Loop
  UnicodeDecode = TempAns
End Function
+1

HTML, .

- , , , , , :

Ανταγωνισμός παγκοσμίου επιπέδου στην κατάρτισ ()

0

, , :

Unicode Visual Basic 6 (Access VBA - VB6)

, , Access/VBA:

  • StrConv()
  • AscB()
  • ChrB()

, .

StrConv() : vbUnicode vbFromUnicode, - , URL- 161 (, - dbLangGreek "; LANGID = 0x0408; CP = 1253; COUNTRY = 0" ).

, , , , . , , .

, - , Trigeminal.com:

- Trigeminal Software, Inc.

... , " I18n ". .NET , VB6/Access VBA.

0

Source: https://habr.com/ru/post/1717072/


All Articles