[GH-ISSUE #1011] XML Charset WINDOWS-1251 issue #1005

Open
opened 2026-03-03 19:23:42 +03:00 by kerem · 11 comments
Owner

Originally created by @azhabort on GitHub (Oct 1, 2021).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1011

Originally assigned to: @NghiaTranUIT on GitHub.

Proxyman version? (Ex. Proxyman 1.4.3)

Version 2.33.0 (23300)

macOS Version? (Ex. mac 10.14)

12.0 Beta (21A5522h)

Steps to reproduce

  1. Make a request and get a response with xml data inside. XML should use windows-1251 charset
    <?xml version="1.0" encoding="windows-1251" ?>
  2. Setup custom body preview tabs and select XML option.
  3. Cyrillic xml data shows with wrong encoding

Expected behavior

XML data with cyrillic characters inside should be encoded correctly.

Screenshots (optional)

raw preview tab:
screen_01
xml body preview tab
screen_02

Originally created by @azhabort on GitHub (Oct 1, 2021). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1011 Originally assigned to: @NghiaTranUIT on GitHub. ### Proxyman version? (Ex. Proxyman 1.4.3) Version 2.33.0 (23300) ### macOS Version? (Ex. mac 10.14) 12.0 Beta (21A5522h) ### Steps to reproduce 1. Make a request and get a response with xml data inside. XML should use windows-1251 charset `<?xml version="1.0" encoding="windows-1251" ?>` 2. Setup custom body preview tabs and select XML option. 3. Cyrillic xml data shows with wrong encoding ### Expected behavior XML data with cyrillic characters inside should be encoded correctly. ### Screenshots (optional) raw preview tab: <img width="613" alt="screen_01" src="https://user-images.githubusercontent.com/6636754/135628250-644de97e-704f-46b1-835e-df335052c60c.png"> xml body preview tab <img width="584" alt="screen_02" src="https://user-images.githubusercontent.com/6636754/135628305-74a01584-2f27-47f1-a8be-b3a7c061cd4d.png">
Author
Owner

@NghiaTranUIT commented on GitHub (Oct 1, 2021):

Thanks for the report @azhabort 👍 It's definitely a bug 🐞

I will fix it and send you a beta soon

<!-- gh-comment-id:932232331 --> @NghiaTranUIT commented on GitHub (Oct 1, 2021): Thanks for the report @azhabort 👍 It's definitely a bug 🐞 I will fix it and send you a beta soon
Author
Owner

@azhabort commented on GitHub (Oct 1, 2021):

@NghiaTranUIT looks like this issue was introduced in 2.33.0 version and relates to fix in the https://github.com/ProxymanApp/Proxyman/issues/989

<!-- gh-comment-id:932240918 --> @azhabort commented on GitHub (Oct 1, 2021): @NghiaTranUIT looks like this issue was introduced in 2.33.0 version and relates to fix in the https://github.com/ProxymanApp/Proxyman/issues/989
Author
Owner

@NghiaTranUIT commented on GitHub (Oct 1, 2021):

If you don't mind, please try this beta build and let me know if it works: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.33.0_Fix_XML_Encoding.dmg

<!-- gh-comment-id:932279927 --> @NghiaTranUIT commented on GitHub (Oct 1, 2021): If you don't mind, please try this beta build and let me know if it works: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.33.0_Fix_XML_Encoding.dmg
Author
Owner

@NghiaTranUIT commented on GitHub (Oct 1, 2021):

Technically, I use NSXMLDocument to prettify the XML content. To parsing the encoding, CFStringConvertIANACharSetNameToEncoding is used to convert IANA name to NSString.Encoding that XMLDocument understand.

However, for some reason, it doesn't work in your cases (windows-2151).

If the beta build doesn't work. I might find alternative solution 👍 @azhabort

<!-- gh-comment-id:932282048 --> @NghiaTranUIT commented on GitHub (Oct 1, 2021): Technically, I use [NSXMLDocument](https://developer.apple.com/documentation/foundation/nsxmldocument) to prettify the XML content. To parsing the encoding, `CFStringConvertIANACharSetNameToEncoding` is used to convert IANA name to NSString.Encoding that XMLDocument understand. However, for some reason, it doesn't work in your cases (windows-2151). If the beta build doesn't work. I might find alternative solution 👍 @azhabort
Author
Owner

@azhabort commented on GitHub (Oct 1, 2021):

@NghiaTranUIT Thanks! I've checked Proxyman_2.33.0_Fix_XML_Encoding.dmg and can confirm that issue is fixed there!

<!-- gh-comment-id:932309858 --> @azhabort commented on GitHub (Oct 1, 2021): @NghiaTranUIT Thanks! I've checked Proxyman_2.33.0_Fix_XML_Encoding.dmg and can confirm that issue is fixed there!
Author
Owner

@NghiaTranUIT commented on GitHub (Oct 2, 2021):

Awesome 😄

<!-- gh-comment-id:932662265 --> @NghiaTranUIT commented on GitHub (Oct 2, 2021): Awesome 😄
Author
Owner

@NghiaTranUIT commented on GitHub (Oct 2, 2021):

Hey @azhabort please try this build too: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.33.0_XML_encoding.dmg

I refactor and use a different library than NSXMLDocument to properly parse the XML content with a given encoding.

This build would fix all encoding issue, include #989 👍

<!-- gh-comment-id:932673059 --> @NghiaTranUIT commented on GitHub (Oct 2, 2021): Hey @azhabort please try this build too: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.33.0_XML_encoding.dmg I refactor and use a different library than NSXMLDocument to properly parse the XML content with a given encoding. This build would fix all encoding issue, include #989 👍
Author
Owner

@azhabort commented on GitHub (Oct 15, 2021):

@NghiaTranUIT Hi! I've checked latest 2.34 version and issue is fixed there.
But alignment is missing now:
Screenshot 2021-10-15 at 16 20 25

<!-- gh-comment-id:944296763 --> @azhabort commented on GitHub (Oct 15, 2021): @NghiaTranUIT Hi! I've checked latest 2.34 version and issue is fixed there. But alignment is missing now: <img width="693" alt="Screenshot 2021-10-15 at 16 20 25" src="https://user-images.githubusercontent.com/6636754/137493537-6675aacd-a8fa-47bf-8aec-51a676e77ece.png">
Author
Owner

@NghiaTranUIT commented on GitHub (Oct 15, 2021):

Sorry for this. Let me check and fix it 😢

<!-- gh-comment-id:944297881 --> @NghiaTranUIT commented on GitHub (Oct 15, 2021): Sorry for this. Let me check and fix it 😢
Author
Owner

@NghiaTranUIT commented on GitHub (Oct 15, 2021):

@azhabort please check this build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.34.0_Fix_XML_Prettify.dmg

Sorry for my mistake, there is one param is missing 🙀

I will roll out a hot fix tomorrow 👍

<!-- gh-comment-id:944310158 --> @NghiaTranUIT commented on GitHub (Oct 15, 2021): @azhabort please check this build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.34.0_Fix_XML_Prettify.dmg Sorry for my mistake, there is one param is missing 🙀 I will roll out a hot fix tomorrow 👍
Author
Owner

@azhabort commented on GitHub (Oct 15, 2021):

@NghiaTranUIT I've checked this version and alignment is finally there!
Screenshot 2021-10-15 at 17 11 26

<!-- gh-comment-id:944335445 --> @azhabort commented on GitHub (Oct 15, 2021): @NghiaTranUIT I've checked this version and alignment is finally there! <img width="488" alt="Screenshot 2021-10-15 at 17 11 26" src="https://user-images.githubusercontent.com/6636754/137501471-720f4288-69b6-4239-93a6-5440df1e6259.png">
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Proxyman#1005
No description provided.