GetUnicodeEncoder returns cached instance

VERIFIED FIXED

Status

()

Core
Internationalization
P3
normal
VERIFIED FIXED
18 years ago
18 years ago

People

(Reporter: nhottanscp, Assigned: nhottanscp)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [nsbeta3+])

Attachments

(1 attachment)

(Assignee)

Description

18 years ago
When I call GetUnicodeEncoder for ISO-8859-1, I am getting a cached encoder.
For example, mErrBehavior is set to kOnError_Replace that is a different from 
the default value kOnError_Signal.

487   nsCOMPtr<nsIUnicodeEncoder> encoder;
488   if (!strncmp(progid+baselen, NS_1BYTE_CODER_PATTERN, 
NS_1BYTE_CODER_PATTERN_LEN))
489   {
490     // Single byte encoders/decoders dont hold state. Optimize by using a 
service.
491     encoder = do_GetService(progid, &res);
492   }
(Assignee)

Comment 1

18 years ago
Nominating for nsbeta3.
By getting a cached encoder, the encoder has states set by someone else.
In the example I mentioned, I cannot do a client side fallback for unmapped 
characters (e.g. transliteration) because the converter internal fallback is 
already set by someone else.
Keywords: nsbeta3
(Assignee)

Updated

18 years ago
Blocks: 46729

Comment 2

18 years ago
DP, you should back out the performance improvement for the encoders: looks like 
the assumption that they are stateless is not true. Keep them for decoders 
though, so far they look ok.
(Assignee)

Comment 3

18 years ago
Reassign to nhotta.
Assignee: dp → nhotta
(Assignee)

Updated

18 years ago
Status: NEW → ASSIGNED
OS: Windows NT → All
Hardware: PC → All
(Assignee)

Comment 4

18 years ago
Created attachment 12684 [details] [diff] [review]
patch to disable caching for encoders

Comment 5

18 years ago
nsbeta3+ to unblock trudelle's group (pavlov). nsbeta3+ per ftang/jaimejr
r=ftang/cata . check it in.
Whiteboard: [nsbeta3+]
(Assignee)

Comment 6

18 years ago
checked in the patch
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED

Comment 7

18 years ago
Verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.